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 | 

Using Java2Python to port a JavaCairo tutorial

Posted by stu at August 21st, 2009

I recently came across Java2Python.  As I’m interested in Cairo I thought it would be interesting to try porting one of the example tutorials from ZetCode.

I’ll run through the steps involved in porting then try and reach some conclusions at the end :) .

1. Get setup

This is easiest in Linux, I’m running Ubuntu (in vmware), and installed

antlr 2.x
python2.5.x
sun java6
pygtk
java-gnome

You can install them like this:

# sudo apt-get install antlr python2.5 sun-java6-bin libjava-gnome-java

Then install Python2Java with easy_install

# sudo easy_install-2.5 java2python

To test if it’s working run j2py -i.  It should complain there is no file:

# j2py -i
Usage: j2py [options]

j2py: error: -i option requires an argument

If you get any other errors your missing some packages.

2. Get the Java Code from the Simple Example.

Save the ’simple.java’ example as ‘GSimple.java’

If java-gnome is running ok, compiling and running it you should see a window:

# javac GSimple.java
# java GSimple

gsimple

Now we’ll run through the code, it’s important to understand what it does before we port it…

(more…)

Posted in Uncategorized, projects| 9 Comments | 

The Bloggage and slacking

Posted by stu at August 7th, 2009

Just been checking out what Mr Palmer has been up to… quite a lot it seems…   if I could get further than 2 chapters in 6 months with Getting Things Done maybe I could stop procrastination and start GTD too :)

And I’ve been checking out some online comics…

My 6 monthlyish check on SayUncle comics blog always makes me want to do some drawing.

Also Quite enjoying the Beartato in space storyline in nedroid.

Posted in Uncategorized| No Comments | 

Toast

Posted by stu at January 9th, 2009

Lyrics

Posted in Uncategorized| No Comments | 

Router upgrade nixed xbmc

Posted by stu at December 14th, 2008

It turns out my lack of networked media consumption utopia via xbmc was all down to upgrading my router… the xbox was fixed on 10.0.0.x while everything else moved over to 192.168.1.x  …so I learned that SMB doesn’t like that at all.

Oh well, one task down… many more todo… maybe I can actually setup my kurobox in the next few days and then some really nice things might be possible.

Posted in Uncategorized| No Comments | 

Noodleglue – found!

Posted by stu at October 1st, 2008

For the last few days I’ve been looking for a project called NoodleGlue.  I got interested when I wanted to look into generating java wrappings for the Verse library.

If you just want to download Noodleglue skip to the end of the article.

Verse is a network protocol that lets 3d applications talk to each other in realtime, being developed by the Blender foundation.  I was wondering how difficult it would be to link the ease of use of processing with the power of Blender.

(more…)

Posted in Uncategorized| 8 Comments | 

Track all your forum posts in delicious

Posted by stu at September 21st, 2008

I’ve been using delicious for a while, but have started bookmarking all my forum posts in there, it should be a lot easier for me to find out whatever I was talking about in the future :)

Posted in Uncategorized| No Comments | 

Warn: There is another system

Posted by stu at September 15th, 2008

Saw “Colossus, The Forbin Project” last night; The U.S. gives an AI control of all it’s nukes… what could possibly go wrong?

Shortly after they turn it, on a message comes up “Warn:  There is another system”, it turns out the Russians have done the same thing, and the system wants a link.  I won’t give away any more of the film, which has some seriously cool looking 70s tech in it (and obligatory wooden panelling everywhere).  I did like the message in the “computer” writing of the time, so made an version in Inkscape, as it would probably make a cool T-Shirt.

Posted in Uncategorized| 2 Comments | 

ZX Spectrum flightsim

Posted by stu at July 12th, 2008

Just found this while going through my phones photos.  This is from my last contract, the company used to be Psions software division, we found the tape in the bottom of a desk draw, who knows maybe it is the master tape for this game?

Psion flight simulation on cassette

Update:  Link to PsionSoftwareLTD promotional information on worldofspectrum.org

Posted in Uncategorized| No Comments | 

What’s in a name?

Posted by stu at April 1st, 2008

…or why “my” is not a valid prefix for a variable

While I’m greatful for examples like this J2Me GameCanvas example I’m not so happy about this bit of it:

/** Starts the canvas by firing up a thread
*/
public void start() {
Thread myThread = new Thread(this);

// Make sure we know we are running
running = true;
done = false;

// Start
myThread.start();
}

What’s wrong ? Quite simply ‘myThread’.  You see the ‘my’ prefix used in code all over the web – it’s extraneous… extra noise, you may as well add ‘the’ to the beginning of every variable.

Variable naming is to a certain extent a matter of taste; a lot of people would say that it is worrying about nothing. The problem is, that most of the time spent with code is reading it, not writing it; as such we should try and be as succinct as possible ‘my’ adds absolutely nothing here.

In the example above it would be better to either leave out the ‘my’ or call the thread canvasThread.

 Fuzzy

Where possible variable names should reflect what you want to use them for, if your naming is fuzzy then others will use them for things you did not intend and then your on the downward spiral…

This is the other crime in variable naming, over generalising… quite often you see variables called ‘data’ when the name of the type would do fine… usually it is only in IO based applications dealing with arbitrary data that the name is appropriate.

Of course, if you can’t think what to name them, then don’t pad them out as well, it’s pointless.

My my my

A quick search on coders (excluding mysql) finds 301,040 hits for ‘my*’.

That’s a lot of noise… stop the madness: ban ‘my’ now… if microsoft can remove it from Vista, how difficult can it be?

Posted in Uncategorized| 3 Comments | 

Next Postings »