Monday, September 10, 2007

Opensolaris on VMWare on WinXP

I was thinking about installing OpenSolaris and or Ubuntu on my laptop (Toshiba m200) which does not have a CD/DVD drive. It seemed non-trivial to boot any installer in this setup. Also I did not know how long my interest would last with new OSs, and did not want to have zillions of partitions lying around.
I had heard about virtualization using VMWare but always thought you had to pay for it. Recently found out that you actually don't. Considered 3 VMWare products
  1. VMWare Player: Can play client OS Snapshots, but cannot create one. (Free)
  2. VMWare Workstation: 30 days free trial, you could create a client snapshot with this and use Player.
  3. VMWare Server: Less user friendly (they say) than Player , but can support multiple client OSs. (Free !!!!)
Went with 3. Decided on installing OpenSolaris (Solaris Express, Developer's Edition) first.

My machine specs 1.5GHz Centrino, 1GB RAM, 40GB disk (of which I had used up 20GB for XP).

Googled and came across "Dave's Blog" on the subject, and followed it (along with the pointer to his "older post"). It went without too many problems. A few things I learnt along the way

Terms: Host OS: WinXP. Client OS=Guest OS =VM = Virtual Machine: OpenSolaris
  • OpenSolaris with Sun Studio needs 768MB RAM. Have at least during install. If you have 1GB like me, you are going to face some slowdown switching between XP and the client OS. But once you have it installed you can lower the memory usage. 512MB works good for me.
  • Setting the login resolution was painful, it seemed to set it too big. You have to go into /etc/X11/xorg.conf and comment out any resoluion large than your max resolution.
  • Had some problems with enabling audio in OpenSolaris. It comes up Muted and cannot be changed. Got it working accidentally when I updated /etc/user_attr for dtrace and logged out and in. Maybe logging out does fix it.
  • Get a large disk allocated for the client. It seems hard to increase it later, though you can add "virtual disks".
  • Unless you have a lot of spare disk, avoid allocating all of this disk up front.
  • Better to allocate in disk in 2GB chunks (an option when creating the Virtual Machine). Lets you backup to DVD easily as well as copy to FAT32 external drives and move between PCs and Apple Mac s if you do desire.
  • Create swap=2X the RAM you allocate.
  • Once you install most things on the VM, take a snapshot in case you screw up the virtual machine later, you can revert back.
Pros:
  • Can change your mind and delete the VM at any time.
  • Can snapshot the machine state (only 1 though).
  • Can copy and clone the VM at any time (better to shutdown the VM first).
  • Can have a variety of OSs on one machine, can try out different OSs and decide for oneself which one you like.
  • No headache of obscure drivers for the client OS (can be a problem for OpenSolaris).
  • Can install the guest OS (VM) on an external drive and thus save disk space.
  • Really useful if you do not have a bootable CD/DVD drive on you laptop like me.
Cons:
  • Slow, espcially when handling OS related apps. YouTube videos not watchable on a browser in the client OS. For work, development etc the speed is enough though.
  • Transferring files painful accross host and guest OSs, or between guest OSs. You have to ftp. You could probably share a virtual disk and use it to copy stuff, but it probably has to FAT32 (with its limitations). I have not tried that yet.
  • Bringing up and Suspending a guest OS is slow. It helps if you have RAM > all the guest OSs you are running.
After Opensolaris worked, installed Ubuntu on a USB external drive as well.