Arch Linux 2010 05 Installation in kvm guest

Preliminary

To perform a net install of ArchLinux in a virtual machine called "archibald" - with 8 GB disk, bridge, sound support and virtio - to a remote host called "bareil", use the following syntax:

# vm-create -c bareil -s 8 -S -b br0 -V -u archlinux archibald
Pool install refreshed

Starting install...
Allocating 'archibald.img'                          | 8.0 GB     00:00     
Creating domain...                                  |   0  B     00:00

You can use the option -t to print the whole command to be passed to virt-install to standard output before executing it:

# vm-create -t -c bareil -s 8 -S -b br0 -V -u archlinux archibald
virt-install 
--connect=qemu+ssh://bareil/system 
--ram=512 
--arch=i386 
--vcpus=1 
--video=vga 
--soundhw=default 
--description="archibald (archlinux) - vm guest on host bareil" 
--os-variant=virtio26 
--disk vol=install/archlinux-2010.05-netinstall-i686.iso,device=cdrom 
--boot=cdrom,hd,network 
--disk pool=default,size=8 
--network bridge=br0 
--vnc 
--vnclisten=0.0.0.0 
--name=archibald

iso URL: ftp://ftp.osuosl.org/pub/archlinux/iso/latest/archlinux-2010.05-
netinstall-i686.iso

A detailled description of the vm-create script has been posted in the openSUSE forum: vm-create : create kvm virtual machines.

* Notice that the option --boot=cdrom,hd,network is not available on virt-install version prior to 5003.

Booting Arch Linux

Booting ArchLinux Setting vesa resolution

You can use the mousewheel to navigate in the slideshow

There are two ways of installing Arch Linux:

We show the interactive method first

Interactive installation: /arch/setup

/arch/setup Welcome Main Menu Source Selection Load ethernet modules manually NET (HTTP/FTP) Installation Interface selection Do you want to use DHCP? Polling for DHCP server The network is configured Choose mirror ftp.archliux.org is throttled Mirror selection NET (HTTP/FTP) Installation Main Menu Date/time configuration Please select a region Please select a timezone Date/time configuration Clock configuration Date/time configuration Date/time configuration Main Menu Prepare Hard Drive Available Disks Disc selection You'll be put into the cfdisk program cfdisk cfdisk cfdisk cfdisk cfdisk cfdisk cfdisk cfdisk cfdisk cfdisk cfdisk cfdisk cfdisk cfdisk cfdisk Disc selection Prepare Hard Drive Partition Access Method Manage filesystem Do you want to have this filesystem (re)created? Select filesystem Select the mountpoint Enter the label Enter any additional opts Manage filesystems Do you want to have this filesystem (re)created? Select filesystem Enter additional opts for mkswap Manage filesystem Do you want to have this filesystem (re)created? Select filesystem Select the mountpoint Enter the label Enter any additional opts Manage filesystem Making filesystems Partitions were successfully created Prepare hard Drive Main Menu Refreshing package database Package selection is split ino two stages... Select Package Groups Select Packages To Install Select Packages To Install Main Menu Package installation will begin now Installing... Please Wait Installing... Please Wait Installing... Please Wait Installing... Please Wait Installation complete Generating glibc base locales... Main Menu Do you want to use the network settings from the installer ... Text editor selection Configuration /etc/rc.conf /etc/rc.conf Configuration /etc/mkinitcpio.conf Configuration /etc/hosts Configuration /etc/hosts.allow change root password Configuration Rebuilding initcpio images... Generating glibc base locales... Main Menu Choose bootloader Generating Grub device map... Before installing Grub you must review the configuration file /mnt/boot/grub/menu.lst Boot device selection Grub was successfully installed Main Menu Installation successfull

You can use the mousewheel to navigate in the slideshow

To use the virtio driver - as you might have seen in the slideshow - we had to add the following modules to /etc/mkinitcio.conf:

To allow Grub to detect the virtio device (vda), you should switch to another console with <ALT + arrow right> BEFORE saving your changes in GRUB configuration file, log in as root and type the following commands:

# echo "(hd0) /dev/vda" > /tmp/aif/aif-dev.map

Then switch back to the console where the setup is running with <ALT + arrow right> and save the GRUB configuration file. You'll be asked where you want to install the bootloader. Select the first /dev/vda entry (don't know why it appears twice) to intall GRUB in MBR.

Automatic installation: aif -p automatic -c

When installing ArchLinux over the network in a virtual machine using the virtio driver, grub can not detect the virtual disk (vda) and fails to install. Writing the device.map before running aif -p automatic doesn't seem to help. Neither does commenting out get_grub_map in /usr/lib/aif/core/procedures. One solution I found was to overwrite worker_install_bootloader in the config file passed to aif -p automatic. IMO it's a dirty hack and should be used only on virtual machines involving the virtio driver.

The steps needed to successfully install Grub in the automatic installation procedure include:

These steps are described in the slideshow below.

configure network get generic-install-on-vda edit generic-install-on-vda aif -o automatic install log installation complete mkinitcpio vi /mnt/boot/grub/menu.lst vi /mnt/boot/grub/menu.lst

You can use the mousewheel to navigate in the slideshow

After install