Saturday, April 3, 2010

Ubuntu 10.04 in Hyper-V

Alright, I wanted to keep our MariaDB (MySQL) instance from choking up our Hyper-V server (we moved it there in an emergency when its previous host started crapping out), so I'm migrating it to an Ubuntu VM. We use Ubuntu for our Linux boxes, and I know Hyper-V doesn't come with "snapshot" stuff for it, but apparently Kernel 2.6.32 absorbed some code to work with the virtual Ethernet adapters. I had tried making the VM with the Legacy driver (emulates a Tulip card), but it kept dropping packets.

Procedure (assuming you know when to sudo)

1. Download the 10.04 Beta, RC, or Final (depending on when you're reading this). You can use x64 if you want, since this is going to be running on an x64 host anyway.
2. While that downloads, make a VM: I used 2GB RAM, 2 virtual CPUs, an 80GB IDE HDD, and a mapping on the virtual LAN adapter (don't need to put it on the WAN).
3. Mount the ISO to the VM and boot it. You probably won't see networking access right away, else you can still set the host name, main user name, and your partitions (I used Guided, but changed EXT4 to JFS per a paper I found on what was a good filesystem for MySQL).
4. When the VM came online, I added the following to /etc/modules & /etc/initramfs-tools/modules

hv_vmbus
hv_storvsc
hv_blkvsc
hv_netvsc

5. Run update-initramfs –u to regenerate the boot image.
6. Edit /etc/network/interfaces & if there are any eth interfaces, change them to seth and add networking parameters as needed. "seth" refers to Microsoft's "synthetic Ethernet". If you're not using DHCP, remember to add nameservers to /etc/resolv.conf
7. Reboot the VM. Assuming Ethernet works, you can apt-get dist-upgrade & optionally load a newer kernel from mainline (The 2.6.33 DEBs don't seem to support seth adapters).
8. If you want to use MariaDB, the Debian 5 repositories appear to work fine.
9. There's a chance the seth adapters won't pickup IPv6 addresses: you can assign static addresses and routes.

References

* Forum thread with Tulip card settings
* "Hyper-V 2008 R2 and Linux guests"
* Blog post on Hyper-V & synthetic network adapters
* Basic networking in Hyper-V
* /etc/network/interfaces guide
* Linux IPv6 HOWTO

No comments:

Post a Comment