I've talked in the past about how much I like OS virtualisation software, like VMware (and I'm keeping an eye on Xen too). I have been successfully using VMware to run Windows XP on my laptop (which had SUSE Linux 9.3 Pro installed).
However, it was time to upgrade to SUSE Linux 10, and so I decided that the time was right to build a virtual laptop. I would have two virtual sessions, one SUSE 10, the other Windows XP. Both would run on top of SUSE 10.
Why do something like this? Well, eventual convenience. If I need to run my laptop's Windows XP installation on my deskside PC (e.g. if there is a problem with my laptop), I can copy it over in about 10 minutes, and it just runs. Using the SUSE backup/restore, it recently took me 10 hours to do a restore, and that was excluding my /home partition, which is bigger than the other partitions combined. Being able to migrate my work quickly and seamlessly from one machine to another is something I've always wanted to do, but was never able to achieve. Software to help you migrate is getting better (the Windows XP migration tool is not bad, and Tim Bray reported similar results for Macs). However, it's still a bit of a chore. Moving virtual sessions is easy - once you get them set up.
Herein lies a long story, and why I haven't posted much in the last week or two. To build my virtual laptop, I had to migrate my SUSE 9.3 laptop installation into a virtual session running SUSE 10. Along the way, I learned a lot, because I did just about every possible wrong thing. I won't try to list them all, but I will try and tell you what works.
Let's start with disk partitioning. I recently wrote about how I partition my disks for Linux, and John Cowan rightly questioned my choices. The biggest failing of my partitioning scheme was that I only had 1G for the root (/) partition, and this turns out to be too little for the /tmp directory (which was part of that partition). That problem was when doing backups, where I was running out of space in the /tmp directory. It seems that I needed at least 1.5G free in /tmp (and that was for a backup that excluded the /home partition).
So, I either needed more space in the root (/) partition, or /tmp in a larger partition (perhaps of its own). Also, I realised that putting /usr and /opt in separate partitions wasn't very helpful, since they are just two sides of the same coin; no point putting aside a lot of space for /opt when most Linux applications seem to install themselves in /usr (RPMs are fine, but they don't give you choices). So, I made big changes to my approach.
Along the way, I trashed the disk structure on my deskside system. There was a problem when I tried plugging in a USB hard disk to a virtual SUSE session in VMware 5 on SUSE 10. It worked, until I tried to log out, when it all came down around my ears. I ending up have to reformat the disk and re-install SUSE 10 on the deskside system. Luckily I don't keep any important stuff on it at the moment. My new partitioning scheme, based on what I had learned, was
- /boot, 16M, ext filesystem
- swap partition, 2G
- /, 15G
- /home, rest of 300G drive.
Simplicity, less chance of running out of /tmp space, but still separate /boot and /home partitions. So it's a middle ground between where I started and what John Cowan suggested. With this, I installed VMware and then created a SUSE 9.3 virtual session that I would eventually migrate to my laptop. This was a very good idea, to build the new session first before touching my laptop. I got it wrong many times, and was glad that after some failures I could just go back to my untouched and working laptop, and then just start over again later.
One thing to note with VMware is that you can't increase the maximum disk size that you set when you create a virtual session, so you have to choose carefully. With 60G on my laptop disk, I would afford 20G for the SUSE session (my Windows XP session is 20G). 20G is OK for me since I can leave larger, and less frequently used files on the physical filesystem and access them from the virtual session as required. My partitioning approach was
- /boot, 16M, ext filesystem
- swap partition, 1G
- /, 10G
- /home, rest of 20G virtual drive.
What worked was to do restore a backup of my laptop (minus /home) into the virtual session. I use rsync to backup /home, as it is a faster way to backup the data you need to backup most often (and /home isn't filled with system files that need special handling). So I used rsync in the reverse direction to get my /home files into the virtual session.
Once I tested that my virtual session was working reasonably (and most importantly, that I could read/send e-mail as normal using Opera), I reformatted my laptop disk for SUSE 10:
- /boot, 16M, ext filesystem
- swap partition, 2G
- /, 10G
- /home, rest of 60G drive.
As well as holding the virtual session files, this base installation will also hold (a) my Subversion version control repository, (b) installation files, and (c) music/video files, since these all need to be shareable between my SUSE Linux and Windows XP sessions. I installed VMware on my laptop, and then copied my two virtual sessions (SUSE 9.3 and Windows XP) across from my deskside PC.
First trick - VMware is tricky to set up for a widescreen display (my laptop is 1280x800). It can be done, check out the VMware forums or send me an e-mail.
Second trick - I wanted to run the SUSE 10 upgrade installer in my SUSE 9.3 session. For VMware, you have to run the installer in text mode, and say no to the "Test Internet Connection" option. I couldn't get the installer into text mode because I couldn't get my SUSE session to boot from the installation DVD! It turns out that to do this, you have to get to the setup screen in the VMware virtual BIOS. You hit the escape key for this, but you only have less than 1 second, so be quick.
Anyway, now it is all running, and I'm using my SUSE 10 virtual session now as I'm typing this. It was a pain getting here, but I think it was worth it. I'll let you know how it works out going forwards.
Recent Comments