Jamie McClelland: From vservers to KVM
Given the impending
deprecation of
vservers, I've decided
to make the switch to KVM on my
laptop. Although lxc is a
closer approximation to vservers, I decided to go with KVM due to it's support
in Virtual Machine Manager.
My first step was to confirm that my CPU would support kvm:
egrep -o "svm vmx" /proc/cpuinfo
If that command outputs either svm or vmx (depending on whether you have Intel
or AMD hardware) then your CPU supports virtualization.
I'm working on a host machine called chicken, which has a logical volume called
vg_chicken0. All vservers on chicken operate on a root filesystem that is
backed by their own logical volume.
In this post, I'll describe the steps to convert the vserver hobo (which
operates on a filesystem mounted on the host in /var/lib/vservers/hobo and
is backed by the logical volume called vg_chicken0-hobo_root).
Both chicken and hobo are running debian squeeze.
vservers don't have a kernel installed or grub. KVM virtual servers need both.
I was hoping I could simply enter the vserver, install both a kernal and grub
and be ready to go. However, grub installation will fail miserably because grub
can't figure out how to install on the underlying disk (which is hidden from the
vserver).
Next, I tried launching a kvm instance, passing a
debirf generated ISO with the -c
(cdrom) option. However, grub recognized that it was being installed onto a
device that did not have a partition table (the logical volume was directly
formatted with a file system).
So, since I had disk space to spare, I created a new logical volume:
lvcreate --size 5GB --name hobo_root_new vg_chicken0
I then added a gpt
partition table (why not prepare for the coming 2TB disks?) and created two
partitions. One partition for grub2 and one for everything else:
parted /dev/mapper/vg_chicken0-hobo_root_new mklabel gpt
parted /dev/mapper/vg_chicken0-hobo_root_new unit s mkpart biosboot 2048 4095
parted /dev/mapper/vg_chicken0-hobo_root_new set 1 bios_grub on
parted /dev/mapper/vg_chicken0-hobo_root_new unit s mkpart primary 4096
When prompted for the end of the last partition, choose: -1 and accept the adjustment.
I had to eyeball cat /proc/partitions to figure out which dm device was the
second partition (dm-19).
I then created a file system:
mkfs -t ext3 /dev/dm-19
Mounted it:
mount /dev/dm-19 /mnt
And rsync'ed the data:
rsync -a /var/lib/vservers/hobo/ /mnt/
With the data in place, I chroot'ed and installed the packages I needed. When prompted, I chose not to install grub to the disk, because I wanted to wait until I had an environment in which the proper disk would be available to grub as it will when the virtual server boots (see below):
chroot /mnt
mount /proc
aptitude install linux-image-2.6-amd64 grub2
umount /proc
exit
Then, I cleaned up:
umount /mnt
umount /var/lib/vservers/hobo
lvremove vg_chicken0/hobo_root
lvrename vg_chicken0/hobo_root_new hobo_root
dmsetup remove /dev/mapper/vg_chicken0-hobo_root_newp1
dmsetup remove /dev/mapper/vg_chicken0-hobo_root_newp2
kpartx -d /dev/mapper/vg_chicken0-hobo_root
And I removed it from /etc/fstab.
Next, I created a new kvm virtual server, using the disk /dev/mapper/vg_chicken0-hobo_root and passing a debirf cd image with -c:
virt-install --name hobo --ram 512 --disk /dev/mapper/vgchicken0-hoboroot -c /usr/local/share/debian/ISOs/debirf-rescuesqueeze2.6.32-5-vserver-amd64.iso
After logging in, I installed grub2 (aptitude update; aptitude install grub2) and then I installed grub:
mount /dev/sda2 /mnt/
grub-install --no-floppy --root-directory=/mnt /dev/sda
After running grub-install, edit /mnt/boot/grub/device.map so it reads:
(hd0) /dev/sda
Then, rerun grub-install command.
I tried generating the grub.cfg file, but got an error message indicating that
grub-probe would not detect the device providing / (because I was running on a
ram file system from debirf).
I added the following to /mnt/etc/fstab:
/dev/sda2 / ext3 errors=remount-ro 0 1
proc /proc proc defaults 0 0
And then re-generate the initrd image:
chroot /mnt
mount /proc
update-initramfs -u
So, I rebooted the virtual machine by typing:
exit
reboot
This dropped me into a grub shell. I manually typed:
root (hd0,gpt2)
linux /vmlinuz root=/dev/sda2 ro
initrd /initrd.img
boot
Once booted, I logged in a completed the task with:
update-grub
For a long time I have mainly been reading Twitter with a generic RSS reader (
Many changes to the UDD-backed
I ve been sitting on this one since more than a month. I ve contacted upstream on the 19.08.2010 and the Debian maintainer on the 02.09.2010. No reaction from them till today, and no, my spamfilter does not eat mail ;)
Still, I won t tell you the name of the software (but you could easily guess or check )
So let s put the grey hat on and begin ;)
Foreword: when I write spam-filter, I mean some DNSBL/SPF/blah filter, not SpamAssassin, crm114 or other content-based filters.
common spam-filters
There are plenty of spam-filters out there which work after the following schema:
There are corners of the Internest where foolish people congregate, and invent stories. These foolish stories are then read as gospel by trusting people, and reposted, until the original made-up source is concealed from view. As an attempt to stem this flow of disinformation, here are some commonly held but incorrect beliefs about the Mono framework, and an explanation of the reality of the situation, as far as I understand it.
The next Mono version is co-developed with Microsoft
There is a grain of truth behind this one, but it s a gross mischaracterisation. Mono 2.8, when it ships, will bundle, for convenience, a number of Free Software libraries, which are released by Microsoft under a license considered Free Software by the Free Software Foundation, the Ms-PL. These are:
I've just committed some patches to the rawhide (not F14) tree that re-enable USB autosuspend on some devices. This set includes a workaround in the bluetooth input code that should handle the case where people were seeing their input devices become laggy when autosuspend was enabled, but there's still some chance that other bluetooth devices will behave slightly oddly. If that's the case then try:
Like many people I use Apache's mod_proxy to proxy from *:80 to a bunch of servers running upon 127.0.0.1:XX.
(I've mentioned this too often; but in short I have a bunch of sites all running with thttpd under their own UID).
Why do I use apache soley as a reverse proxy, instead of pound, varnish, nginx, or lighttpd? After all it is pretty heavy-weight. Well the answer to that is that I have a bunch of mod_rewrite rules.
So I'm wondering, could I drop apache if I were to hack together a simple network proxy that would listen upon port 80, reading requests, and directing them to local servers? The answer to that is plainly "yes". There are many reverse-proxies around and writing them isn't hard.
So what would be the point? Imagine a reverse-proxy that understood mod_rewrite rules. That would rock.
In short we'd have to define three things:
While gzip is the standard Unix tool when it comes to compression, there are other tools available and some of them are performing better than gzip in terms of compression ratio. This article will explain where you can make use of them in your Debian packaging work.
In the source package
A source package is composed of multiple files. The .dsc file is always uncompressed and it s fine since it s a small textual file. The upstream tarballs can be compressed with gzip (orig.tar.gz), bzip2 (orig.tar.bz2), lzma (orig.tar.lzma) or xz (orig.tar.xz), so choose the one that you want if upstream provides the tarball compressed with multiple tools. Put it at the right place and dpkg-source will automatically use it. Note however that packages using source format 1.0 are restricted to gzip, and the main Debian archive currently only allows gzip and bzip2 (xz might be allowed later) even if the source format 3.0 (quilt) supports all of them.
The debian packaging files are provided either in a .diff.gz file for source format 1.0 (again only gzip is supported) or in a .debian.tar file for source format 3.0 (quilt) . The latter tarball can be compressed with the tool of your choice, you just have to tell dpkg-source which one to use (see below, note that gzip is the default).
In a native package, dpkg-source must generate the main tarball and you can instruct it to use another tool than gzip with the 
The
I use the following python script to choose a random background on login:
The Apple universe is happy to live with whatever Steve Jobs allows to get in. Numerous examples going back at least 20 years are available; most recent Apple's
The phpMyAdmin's