[GLLUG] Virtualization Questions

David L Lambert davidl at lmert.com
Tue Oct 4 07:58:21 EDT 2011


First of all,  to summarize other people's replies and add my own knowledge:

For pure-open-source, pure-user-mode virtualization on Linux or BSD or 
Windows,  look at qemu.  It will let you emulate a Motorola 68000 
processor on x64 Linux,  or Sparc64 or x64 system on 32-bit Linux.

For hardware-assisted virtualization (which lets you run x86 guests on 
an x86 host, or x86 and x64 images on an x64 host, and lets you have 
more "direct" access to hardware), you generally need support in the 
kernel, support in the CPU, and enhanced privileges for at least some 
programs used for virtualization.  The current options I know of on 
Linux are:

* KVM (for which qemu provides a front-end)
* XEN (for which qemu provides a front-end)
* VirtualBox
* VMware (commercial, but a limited-use free version is available;  it 
worked OK on RedHat but I haven't gotten it to work on recent Debian)
* and I guess you could try running Microsoft Virtual PC in Wine, I 
haven't tried that recently enough to remember any details

You don't /need/ special hardware to do virtualization.  Your VM 
"physical" memory is limited only by the virtual memory that may be 
allocated to a single process in the host OS, and the disk image can be 
anything the OS can use as a random-access file,  including a 
sparsely-allocated file (so you can have a 5TB virtual disk on a 160G 
real disk,  as long as you don't actually use very much of it), a file 
on LVM, an external USB or eSATA device, a partition mounted with iSCSI 
or a file on such a partition, or a file on an NFS or SMB server.

That said,  if you allocate exactly as much memory to the VM(s) as is in 
the host,  and you're running memory-intensive programs is it/them,  you 
will have swapping.  Qemu uses 726M of virtual memory for a 480M virtual 
machine, but that can all be swapped.  VMware offers a tuning parameter 
per VM for whether it can "mostly", "partly" or "not" be swapped.  
There's also a performance-hit;  the VM is always measurably slower in 
CPU speed, but the factor could be as little as a percentage or as much 
as thirty times.  If you want to run actual workloads (database server, 
compilation, office apps...) on the guest,  and not just prove that some 
unusual OS boots, you need host hardware at least as powerful as what 
the guest OS was designed for.

On 10/02/2011 02:23 PM, Chick Tower wrote:
> [...] Are there ready-made guest OS packages available, or do we have 
> to create our own?
>
Philip pointed out a site full of pre-built VIrtualBox images.  THere's 
also a VMware marketplace,  and it should be possible to convert any 
image in there to qemu or VirtualBox format with tools that qemu provides.
> To create a guest OS package (or container or whatever the 
> nomenclature is), is it necessary to create an empty one and then 
> install an OS, or can you clone an existing OS installation?
Both procedures are possible.  If you want to make optimum use of 
resources, or have a perfectly "clean" instance,  or want to try out an 
OS you don't have a physical instance of,  you would just create a fresh 
VM with an empty disk,  map the OS installer's ".iso" file as the 
virtual CD-ROM drive,  boot, and install.  If you want to "consolidate" 
about-to-fail or leased hardware onto a more-stable VM with minimal 
changes to the OS,  but can afford enough downtime for a reboot,  you 
could shut the physical system down,  copy the drive(s) to image files 
(or move the drives to the server,  if you're more confident in the 
drives than the rest of the server), and boot from them.  You would 
typically still have to reconfigure device names, etc., on the guest.
> Is it possible to modify the saved version of a guest OS (such as for 
> software updates or configuration changes), or would you have to 
> create a new saved version?  I realize allowing the guest OS to 
> permanently modify itself could be considered a security risk 
> (although normally-installed OSes do it all the time), but it would be 
> convenient.
>
Yes.

QEMU lets you work from a snapshot of the disk,  or write back all 
changes (the default).

VMware also lets you take a snapshot (mutiple snapshots,  in the paid 
version) of the /in-memory/ state of the virtual machine.

Once you have a disk image,  you can use binary "diff" tools to store 
just the differences, or LVM snapshots as a backup method,  etc.

> Can a running instance of a guest OS save data in external 
> filesystems?  If so, can those external filesystems be simply mounted 
> like any other, or would it require some trickery?
Not sure what you mean by "external".  Generally the host can mount the 
filesystems on a not-in-use disk image somehow.  Also,  the VM can 
access any network filesystem it can talk to:  SMB, NFS, ZFS or GPFS on 
iSCSI or NBD, SSHFS, ... including one on the host,  if the host is an 
SMB or NFS or SSH server.  (I run NFS over PPP over SSH to mount /home 
on a couple qemu VMs from a file-server on the same LAN,  and it's fast 
enough for what I'm doing in those VMs.)

Some virtualization software supports directly exposing a whole host 
device as a guest device;  but if you're running a typical local 
filesystem (FAT32, NTFS, ext2/3/4, ...) on the partitions on that 
device,  the host shouldn't access it at the same time;  that will cause 
filesystem corruption, or even host and guest kernel failure.


-- 
David Lee Lambert (also  davidleelambert at yahoo.com , lamber45 at msu.edu )
Member IEEE, ACM (david.lee.lambert at acm.org) - formerly as4109 at wayne.edu
Ph# (616)676-7375, LI profile http://www.linkedin.com/pub/david-lambert/12/831/26b
IM: davidleelambert (Yahoo!) or lamber45 at cse.msu.edu (MSN)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.egr.msu.edu/mailman/public/linux-user/attachments/20111004/f6421d44/attachment.html>


More information about the linux-user mailing list