Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a virtualbox VM that is broken. It won't boot normally. I don't want to bother trying to fix it but I do want to get some files off it that I need.

If I hold down the shift key I can get to a prompt allowing me to boot into recovery mode and from there I can select the option netroot and I'm in. I can get to the files on that machine which I need and the internet works (I can run wget --spider succesfully.) So it seems like I should have everything I need to get the files off. But how? I thought about trying to setup an FTP server but I'm wondering if there isn't an easier way.

I am running Ubuntu 12.04 on the host and 10.04LT on the client (VM).

share|improve this question
up vote 2 down vote accepted

An easy way would be to enable SSH on your host, then mount a folder via SSH on your VM.

openssh-serverInstall openssh-server

On the host:

sudo apt-get install openssh-server
mkdir ~/vm_backup

On the VM:

sshfsInstall sshfs

apt-get install sshfs
mkdir /mnt/host
sshfs [username]@[host]:/home/[username]/vm_backup /mnt/host


  • Replace [username] with the username on the host.
  • Replace [host] with either the IP address or hostname of the host

Then you can just copy everything you need to /mnt/host

When you are done, if you do not want SSH anymore, simply uninstall it.

sudo apt-get remove openssh-server
share|improve this answer
awesome. thanks. just what I needed! – snowguy Jul 24 '12 at 17:18
No problem. I'm glad I could be of help. :-) – reverendj1 Jul 24 '12 at 17:18

I do this regularly and you don't even have to start the virtual machine itself. The idea is to mount the disk image on your host machine.

To do this, you'll need virtualbox-fuseInstall virtualbox-fuse on the host:

$ sudo apt-get install virtualbox-fuse

You can then mount the image using vdfuse. Per example, mounting a VDI image (VMDK and al are also supported), as root:

$ mkdir /mnt/vdi
$ vdfuse -f /path/to/disk/image.vdi /mnt/vdi

In /mnt/vdi, you'll have a disk image for each partition and one for the entire disk:

$ ls /mnt/vdi
EntireDisk  Partition1  Partition2

Mount the partition you want:

$ mkdir /mnt/guest
$ mount /mnt/vdi/Partition2 /mnt/guest

And that's it. You can now copy your files from /mnt/guest to your host machine without any network overhead whatsoever.

It's also useful for a ton of other things other than backing up broken VMs. ;-)

share|improve this answer
Wow. This is great. I already got the files off the other way, but I agree this is really good to know. – snowguy Jul 24 '12 at 20:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.