I'm planning on building an Ubuntu server that primarily needs to be a file server, but due to budgetary constraints will likely get used for running virtual images for a couple of different development / server projects (probably rarely concurrently; will be mostly testing).

I have looked into various virtualisation solutions (Xen, KVM, VirtualBox) and am currently thinking I will go with KVM, although I'm new to this in a server context (I've used Virtual PC on Windows extensively).

My question is: Should I go "the whole hog" and have everything virtualised or should I just virtualise the additional OSs and keep the file server at the host level?

I would instinctively have gone for virtualising everything, but if I'm using a virtual server for the file server I presume this would result in some massive single file on the host that contained all my file servers files. I was just concerned this might cause potential issues (I know fairly large files are fine but I wasn't sure how big would be okay and if say 500Gb might start to become a problem!)

The other thing is that perhaps I'm missing a trick here, due to my relative new-ness with KVM and server virtualisation. (at the risk of sounding very uninformed...) Is it necessary that the files the file server reside in that image or perhaps can they reside at the host OS level and still have the file server responsible for serving them to my network?

More specifics in case they help:

Intended Host OS: Ubuntu 9.10 Server

Guest OSs: most are likely to be Ubuntu 9.10 Server but ideally I'm hoping to use Windows 7 for testing on a particular project.

Guest OS uses anticipated to include: (potentially) file server; a mediawiki install (plus a test version); web server (Apache) for some simple internal use webpages that can't be on the same machine as the mediawiki machine; Win7 test machine;

For all access I'm planning on connecting remotely with SSH (although I'll be in the same location as the server the majority of the time

Any (constructive) advice gratefully received!

Thanks, Neil

2 Answers 2


KVM and possibly the other solutions, allow you to present an entire block device to the guest OS. You could, for example, set up a dedicated LVM partition (or even complete disk drive) on the host system for your file server files, and present that to your file-server virtual machine as a hard drive mounted at /srv, for example.

That way you haven't got one huge file for your server - just a partition on the host's disks. That would take care of the files residing on the host but being served by the virtual file server to your network.

I've got a very similar setup, also on Ubuntu 9.10 with KVM, where I've got an LDAP directory and 6 virtual servers running atop 2 physical servers. I was torn with the same situation as yourself - do I set up 2 virtual machines to host the LDAP, or run it on the physical machines? My answer was because the physical machines also need access to LDAP, I'll host it on the physical boxes. If I'd done it the other way around, and the virtual LDAP server failed, the physical servers wouldn't be able to use it. But if the physical server fails, the virtual machines will have failed also so it doesn't matter that LDAP isn't working!

In my setup, the whole virtual machines are on LVM partitions at the host level, because they're replicated between the 2 physical machines using DRBD, so if one physical box dies, they can be bought up quickly on the other. The complete LVM partition is presented to the VM as a SCSI hard drive, and the VM then partitions that "hard drive" also using LVM.

  • Hi Andy, Many thanks for your comments - I'm glad I wasn't the only one who'd thought of this scenario/dilema! I'll look into using the block device in the guest OS - now I know the right phrases / sections to look out for in the KVM documentation. Plus Google's bound to help too; I already found comments relating to use of block devices in KVM here: 1. forums.convirture.com/viewtopic.php?f=16&t=261&p=2197 2. blog.zugschlus.de/archives/882-Block-devices-in-KVM-guests.html
    – Neil
    Feb 24, 2010 at 11:49
  • @Neil - not a problem, I suspect others face the same issue. My previous organisation virtualised everything but the AD servers because they were so critical - for me that wasn't an option. If you're not already, I'd suggest using libvirt to manage your KVM machines - you create XML files with the setup you want, then "define" the resource (machine, volume, etc) in libvirt which manages the machines for you, so you can start/stop them easily etc. The XML is quite easy to create once you get your head around the documentation which is lacking in some areas. Feb 24, 2010 at 19:03
  • Libvirt XML format: libvirt.org/format.html. Note "domain" = virtual machine. Another advantage with using block devices is you don't need to worry about creating pools and volumes - just tell your machine to use the block device and you're good to go :-) Feb 24, 2010 at 19:04

Mind that if you fully virtualize the file server without VT-d-like technologies and proper hardware, this will have no access to HDD SMART info, so consider what kind of reliability do you need.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .