Change IDE to VirtIO Disk in KVM

I want to show you how to change an IDE disk to a VirtIO disk in an already done guest. In my example it is a FreeBSD 10.3 guest:

First open your guest's /etc/fstab and change:

all /dev/ada0pX to /dev/vtbd0pX (FreeBSD only)
all /dev/sdaX to /dev/vdaX (Linux only)

Now shutdown the guest and connect to your KVM host's shell. Then type:

# virsh edit <SERVER_DOMAIN>

find following line:

<disk type='file' device='disk'>
    ...
    <target dev='hda' bus='ide'/>
    ...
</disk>

and change it to

<target dev='vda' bus='virtio'/>

also remove all occurance of "<address type=…" within the same disk section. On save KVM will regenerate the line for you. Note that this part is needed for correct disk values wihtin the guest!

Now restart your guest and everything should be running.

# virsh start >SERVER_DOMAIN>

PLEASE NOTE: This method has worked for me on any Linux/FreeBSD guest but apparently there were some windows installations were this method broke the MBR, so please do a backup first!

Install MATE desktop on FreeBSD 10.3

FreeBSD has no GUI in its initial installation state. Here are a few steps to get the MATE desktop up and running using the binary packages. Note that the packages could also be installed by using the ports collection. For easy configuration i prefer to use VIM but it needs to be installed first. Use following command:

pkg install vim

Installing the X Window System

This is needed by the desktop environment and can be installed easily by using

pkg install xorg

Configuring the X Window System

Now we need a few commands and edit to configure the system. As root do the following

vim /boot/loader.conf

add this line at the top:

kern.vty=vt

Installing SLIM and MATE desktop

It's time to install your graphical interface… MATE does not come with a login manager sou you need to install one like SLIM.

pkg install mate
pkg install slim

after installation add this to /etc/fstab

proc          /proc       procfs  rw  0  0

now everything should be ready. Only one more step: add the following lines to /etc/rc.conf to start the desktop environment at boot:

moused_enable="YES"
dbus_enable="YES"
hald_enable="YES"
slim_enable="YES"

REMEMBER:

If you want a user to login to the MATE desktop, replace the user and execute the following command:

echo "exec mate-session" > /home/<myuser>/.xinitrc

VMWARE USERS:

Should you run this FreeBSD setup in a VMware product like VMware Fusion please install following packages:

pkg install xf86-video-vmware xf86-input-vmmouse