Access files in a Linux virtual machine from Windows

Posted by stu at January 21st, 2010

I recently found a neat way of accessing files in a linux VMWare image.   This is really useful, as theres never really a good time to break your VMWare image, this is also handy if you don’t want to run the whole machine, but just access the files inside.

There is one caveat:

  • It only works if the filesystem is ext2 (ext3 works, and ext4 probably works).

Install VMWare DiskMount Utility

Accept the EULA, download and install the VMWare DiskMount utility.

For convenience add the utilities folder to the path:

C:\Program Files\VMware\VMware DiskMount Utility

Do this through the Windows Gui, or even use my addpath utility.

At this point you can mount Windows VMWare images.

The usage is:  vmware-mount drive-letter vmdk-image.

Heres how I mount my Ubuntu image to the j: drive

[C:\vmware\Ubuntu]vmware-mount j: ubuntu.vmdk
[C:\vmware\Ubuntu]

No output here indicates success.

At this point everything seems fine, but a crucial piece of the puzzle is still missing; try and view the files and you still can’t:

Failing to see files in an ext2 VMWare image

The next step is to make Windows understand the ext2 filesystem, using a special driver.

Install ext2ifs

Grab ext2ifs from www.fs-driver.org and install.

If the following steps don’t work then you may need to reboot.

Thats it!

You should be now able to access files inside your VMWare image (assuming it’s ext2 and not reiserfs), remount the image and have a go:

In my case I did:

[C:\vmware\Ubuntu]vmware-mount j: ubuntu.vmdk
[C:\vmware\Ubuntu] dir j:

Heres the output – hooray, I can copy my work out of the image !

Viewing files inside a VMWare image with ext2fs

This is very useful, especially if you do dist-upgrade in ubuntu and can’t access the network.

Bonus tip:

Newer versions of VMWare player let you install VMWare tools from inside the GUI, this is another way to fix the kind of catestrophic problems you can cause yourself by accidentally upgrading the kernel in an image.

Posted in Uncategorized| No Comments | 

Virtual Machines in version control

Posted by stu at September 28th, 2008

I’ve been interested for a while in putting virtual machines into version control – I haven’t tried it yet as I’d imagine most modern vcs would grind to a halt.    The idea is – keep your machine in something like git (I hear it’s the most space efficient – svn would be a definate nono), and keep a copy on one of the large usb sticks that are now available.

(more…)

Posted in general| No Comments |