Still playing with KVM (Kernel-based Virtual Machine), this time checking out some networking features. I've been running Ubuntu 8.04 LTS Server (Hardy Heron), both as the host and as a VM on that host. Networking is setup to use a bridge.
KVM offers different emulated NICs, I took a quick look at running iperf between the VM and the host, and got these speeds for a few select NIC models:
The thing about virtio though is that it doesn't work when the VMs RAM is set to 4GB. So I guess you can have fast networking, or lots of memory, but not both.
posted at: 09:16 | tags: kvm linux ubuntu | 0 comments | permanent link to this entry
I'm still experimenting with Ubuntu 8.04 Server (Hardy Heron), and have switched from Xen to KVM (Kernel-based Virtual Machine). Xen worked well on a little test machine I had, but when I tried it on a brand-new Supermicro server, it turned out to have a problem with the Intel NIC. Since it seems Ubuntu is recommending KVM over Xen, and the server supports hardware virtualization, I figured I'd give it a try.
One big difference is that KVM does full emulation, which means any disk space you give it from LVM (Logical Volume Manager), will be a full virtual disk, with a partition table. It's a little more complicated to access filesystems within the virtual disk that it was with Xen, I wanted to jot some notes down here mostly for myself on how to do that.
If I've created a logical volume named /dev/myvg/test_vm and installed another linux on it with a single ext3 filesystem (/dev/sda1 from the point of view of the VM) and some swap space (/dev/sda5), it can be accessed when the VM isn't running with the help of the kpartx utility...
kpartx -av /dev/myvg/test_vm
would read the partition table on the virtual disk and create:
/dev/mapper/myvg-test_vm1
/dev/mapper/myvg-test_vm2
/dev/mapper/myvg-test_vm5
Then you can
mount /dev/mapper/myvg-test_vm1 /mnt
to mess with the VMs /dev/sda1. To clean things up when finished, run:
umount /mnt
kpartx -d /dev/myvg/test_vm
If you want to look at the contents of a running VM's disks (perhaps for backing it up) you can use LVM snapshots. For example:
lvcreate --snapshot --size 1G --name test_snap /dev/myvg/test_vm
kpartx -av /dev/myvg/test_snap
mount /dev/mapper/myvg-test_snap1 /mnt
.
(play with VM's /dev/sda1 in /mnt)
.
umount /mnt
kpartx -dv /dev/myvg/test_snap
lvremove /dev/myvg/test_snap
posted at: 11:25 | tags: kvm linux ubuntu xen | 1 comment | permanent link to this entry
This is mostly a note to myself... After setting up a minimal Ubuntu server install (in Xen), following these instructions using debootstrap I saw lots of errors like this:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Checking with locale -a would show
C
POSIX
While a full Ubuntu server install (off a CD) would show:
C
en_US.utf8
POSIX
This command seems to have generated the missing locale and made everybody happy.
localedef --no-archive -i en_US -c -f UTF-8 en_US.UTF-8
posted at: 12:17 | tags: linux ubuntu | 2 comments | permanent link to this entry
I've been experimenting with setting up Ubuntu Server 8.04 (Hardy Heron) to run Xen, and had a minor problem with UFW (Uncomplicated Firewall) running in the dom0 blocking network access to a domU running in bridged mode. It seems the fix is just to edit /etc/defaults/ufw and make this change to enable forwarding:
--- a/default/ufw Thu Oct 23 10:00:33 2008 -0500 +++ b/default/ufw Thu Oct 23 10:34:36 2008 -0500 @@ -16,7 +16,7 @@ DEFAULT_OUTPUT_POLICY="ACCEPT" # set the default forward policy to ACCEPT or DROP. Please note that if you # change this you will most likely want to adjust your rules -DEFAULT_FORWARD_POLICY="DROP" +DEFAULT_FORWARD_POLICY="ACCEPT" # # IPT backend
and then run ufw disable; ufw enable.
I believe dom0 is now protected, and it'll be up the the domU to protect itself. I can't say I'm entirely comfortable with Linux IPTables, sure wish PF was available as an alternative.
posted at: 10:43 | tags: linux ubuntu xen | 0 comments | permanent link to this entry