wiki:debirf-boot-on-kvm-guest

Version 3 (modified by Jamie McClelland, 12 years ago) ( diff )

--

Debirf Image on KVM guest

debirf is a minimal debian installation that runs entirely in RAM, allowing you to have full access to any underlying disks (among other benefits).

To boot a KVM guest to debirf, first ensure that you have a debirf .iso file in /usr/local/share/ISOs on the host (if not, you can download a pre-built one.

Then, create a symlink from /home/<guest>/vms/<guest>/cd.iso to this downloaded file and shutdown the guest.

You can access the debirf image via the kvm console (ssh <guest>@<host>.mayfirst.org screen -x).

Login as root (with no password).

Root password

If you are planning on turning on networking, it's a good idea to set a root password first:

passwd

Networking

You can setup networking with the following commands:

ip=209.51.163.203/28 gateway=209.51.163.193 && \
 ip addr add "$ip" dev eth0 && \
 ip link set dev eth0 up && \
 ip route add default via "$gateway" dev eth0
echo "nameserver 216.66.23.46" > /etc/resolv.conf

Installing packages =

You can install any debian package, but remember to run:

apt-get update

The apt cache is not populated already.

Mounting filesystems

debirf should discover all logical volumes, so mounting a logicaly volume can be accomplished with:

mount /dev/mapper/path-to-volume /mnt

For example:

mount /dev/mapper/vg_leslie0-root /mnt
mount /dev/mapper/vg_leslie0-var /mnt/var
mount /dev/mapper/vg_leslie0-tmp /mnt/tmp/
mount /dev/mapper/vg_leslie0-srv /mnt/srv

chroot

If you want to operate in a chroot environment, you will also need to mount some special filesystems:

for fs in dev proc sys; do mount -o bind /$fs /mnt/$fs; done

Then:

chroot /mnt
Note: See TracWiki for help on using the wiki.