(Solved) troubles with Ubuntu, VirtualBox, OpenVZ/Proxmox and MySQL

Positive start: my new Dell XPS 8100 is now ready for work. To achieve that I had to overcome a couple of puzzlers. They were mostly related to my weird requirements, which I guess are not the common set up path…

The weird setup

  • The choice of desktop OS is sort of trivial – Ubuntu 10.04 Lucid Lynx. The reasoning is simple – 99% of things just work and I’m quite familiar with it. The active community plays a large part too.
  • VirtualBox as the main virtualizer. I’m already a bit familiar with it, and I like its small footprint and the fact that it is easy to setup. I also made a stupid mistake of activating my Windows 7 inside of it, before trying out other VM software. At the end of the day – with guest additions installed, it is absolutely amazing and I have no problems there. Seriously – I can watch YouTube inside Win7 inside a VM practically without glitches!
  • Proxmox Virtual Environment inside the aforementioned Virtualbox. Now, some might say I’m crazy to run a VM inside a VM, but using containers is far more efficient (especially due to low RAM usage) than running real VMs. Considering OpenVZ was not included in Lucid, and LXC is by far not ready (read: I don’t have enough time to learn everything without proper documentation), Proxmox was an easy choice to make. I’m already using it in production and I’m really happy with how easy it is to setup and maintain.
  • Ubuntu Lucid again, to host services (Apache, MySQL, couchdb, etc) inside OpenVZ containers. I absolutely love the minimal OpenVZ templates. The only reason I’m not going for Debian here is the fact that the releases don’t happen frequently enough for my liking. I may reconsider this down the road – but for now – Ubuntu works out for me better.

Problem 1. Proxmox didn’t like being inside VirtualBox

I downloaded the “bare metal installer” and tried to start it in a VM. All went well until the first reboot, and then it would just hang after detecting the (virtual) hard disks. Took me a couple of hours of scratching my head, until I installed pure Debian inside VirtualBox. Strangely, during installation, the hard drive was appearing as hda, but after finishing, would all of a sudden change to sda, which obviously made things go really sour.

Solution: change the IDE controller (VM properties -> Storage) from the default PIIX4 to ICH6. I have no clue what all of this means, but the resulting VM now boots fine.

Problem 2. fsck during every boot due to “last mount time in the future”

This one is simple – the VM has no access to the hardware clock, which by default is expected to be set to UTC, so your true time gets double-adjusted (once in the host, once in the guest). To fix edit /etc/default/rcS and make sure UTC=no.

Problem 3. MySQL won’t start inside Lucid inside OpenVZ

Considering that Lucid doesn’t really support being the host, or the guest of OpenVZ, this comes as no surprise and the bug is marked as “Won’t fix“. Luckily, there’s a smart guy, who has a workaround. Solution: edit /etc/init/mysql.conf to have it start on runlevel [2345], instead of the default method, which depends on networking.

I think, I now have all the ingredients to start working on the ??? part!

2 Responses to “(Solved) troubles with Ubuntu, VirtualBox, OpenVZ/Proxmox and MySQL”

Comment RSS

The strange thing is your weird setup actually makes perfect sense to me, at least for setting up testing appliances. I was thinking of doing a sipwitch testing appliance and a backup/test site for my main public site, which uses mediawiki, and maybe something for something else. None of these really require a full vm by themselves (which seems a huge waste of resources), I did not wish to mix them together in testing, nor did I wish to dedicate a box just for things that have rather transient use. Disk space and memory I do have plenty of on my main dev box, I too have become rather familiar with virtualbox, and I also like it’s small footprint and simplicity.

It’s possible with the newer kernel in proxmox 1.6 (it now uses 2.6.32) will remap /dev/sda correctly from first boot, though I think I may try the virtualbox sata if it has better performance.

Interesting. I thought I was the first one to have this idea. To good this is that at least I know now that what I was doing is not that crazy at all. I also have Windows 7 and Proxmox running on VirtualBox. It works flawlessly and take far less resources when using ONLY OpenVZ containers.

I have an annoyance that I am experiencing though … My home network is using 192.168.2.x … and Proxmox is using 192.168.2.15 (static IP configured inside Proxmox)

Unfortunately, as soon as I am on another network, the IP 192.168.2.15 will be unavailable. Maybe it’s just a matter of create an alias for the interface and use that IP instead of the one that matches the current network.

Cheers.