Sunday, 17 June 2007

Use Linux on Windows (for free!)

My Dell laptop runs WinXP, but I find it useful to have access to Linux. Here are the steps you need to take to run a Linux distribution from Windows using VMWare, who provide VMWare Player (and also VMWare Server) for free.

I find this method of accessing Linux useful:
(1) because I need to develop software on Linux and Windows
(2) it's nicer than Putty if you need to 'ssh' somewhere
(3) you don't need to reboot your computer to use Linux
(4) you can close the virtual machine and it starts up at the same point next time
(5) if you use VMWare Server, you can take snapshots of your entire operating system and state, which you can continue from later or give to other people
(6) no need to install Linux yourself or repartition your hard drive
(7) security -- let the hackers hack your virtual machine rather than your desktop PC
(8) you can test webservices, as the virtual machine behaves like a completely different PC

It's pretty easy to setup:
(1) Download and install VMWare Player from the link above
(2) Download a virtual machine containing a Linux distribution from the VMWare site (for example). I downloaded a virtual machine of Debian Etch. What's good about Debian is that it's stable, and has a really nice package installation system containing 19000 packages.
(3) Start the virtual machine by opening in VMWare Player, and sit back while it boots up.
(4) The one difficulty with VMWare is getting the networking to work. As described on the home page for this virtual machine, you need to start the VMWare network driver by entering the following as root (the passwords for 'user' and 'root' and simply 'user' and 'root'):

/etc/init.d/networking stop
rmmod pcnet32
rmmod vmxnet
depmod -a
modprobe vmxnet
/etc/init.d/networking start

If it worked, the output of '/sbin/ifconfig' should show eth0 as a network driver, and it should be possible to access the internet, and 'ssh' out of the machine.
(5) At this point, you can start installing whatever packages you want, by clicking on "Desktop", "Administration", "Synaptic Package Manager" (or use the command-line interface, 'apt-get install whatever')

Here's the obligatory screenshot showing me writing this blog post on Windows, and running VMWare/Debian at the same time. I've just installed and run GaussSum at the command line:

3 comments:

Noel O'Boyle said...

If you're behind a proxy, in your .profile put "export http_proxy=http://whereever.org:portno"

and in the manual configuration of Iceweasel connection settings put
"whereever.org" into the HTTP proxy box (note: don't include the http://), and the port number in the port box.

Egon Willighagen said...

Thanx for the tip! I knew about it for a long time, but your blog convinced me to give it a try. So far I am *very* contend with it, and have Debian Etch and Fedora7 images installed (running on my Kubuntu Feisty system). It is very much faster than I had expected for my single core, single processor system.

This is really good for testing our tools. Fedora has, for example, a much more up-to-date support for the free Java virtual machines, than Ubuntu has.

Anyone with tips for running Win98? I have my old install CD somewhere, and want to give that a go too.

Primp and Prettify said...

Thanks for the info now i have that VMware on my pc... I'm using linux but if i need to test something i also use vmware to have windows running... nice... thanks

kanati