mafflog
random stuff for teh interwebs
  • About
  • Projects
  • Archives
Home » virtualization

Install Windows Server 2008 on KVM/VirtIO

March 14, 2011 · in How-Tos, Linux, Server, Windows

An example how to install a Windows Server 2008 guest on KVM with VirtIO (on a LVM volume in the example). Besides the installation medium you need the VirtIO drivers for windows in order to be able to access the disk device. You can get signed binary drivers here. Then set up a Windows VM with a command like this:

$ virt-install --connect qemu:///system --arch=x86_64 -n win2k8 -r 1024 --vcpus=2 \
--disk pool=vmstore,size=50,bus=virtio,cache=none -c /path/to/win2k8.iso --vnc \
--noautoconsole --os-type windows --os-variant win2k8 --network network=subnet,model=e1000 \
--disk path=/path/to/virtio-win-1.1.16.iso,device=cdrom,perms=ro

When the guest is running, shut it down and edit the os section of the XML file to look like this (otherwise Windows setup won’t let you install on the disk):

$ virsh destroy win2k8
$ virsh edit win2k8

Change the XML as follows:

<os>
  ...
  <boot dev='cdrom'/>
  <boot dev='hd'/>
</os>

Start the guest again:

$ virsh start win2k8

Connect to the VNC console and start the installation process. When you reach the form to select a disk device you won’t see any devices available. Click on “Load drivers” at the bottom left and load the drivers from E:\viostor\wlh\{amd64|x86}. After the drivers are installed, you’ll see a disk device and can continue with the installation.

Sources

  • Installing Win Server 2008 R2 as a KVM Guest with VirtIO
  • Installing Windows 7 as a KVM virtualized guest on Debian 6.0 Squeeze

Use a LVM volume group with libvirt

February 26, 2011 · in How-Tos, Linux, Server

A short howto how to use a LVM volume group with libvirt on Debian Squeeze (used for KVM VMs in my case). I assume your VG already exists and is dedicated for libvirt usage. In my case it’s /dev/vg1.

First of all, create the XML definition for the storage pool in /etc/libvirt/storage/vg1.xml. This is the minimal configuration needed, libvirt will extend it with things like UUID when you define it.

<pool type='logical'>
  <name>vg1</name>
  <target>
    <path>/dev/vg1</path>
  </target>
</pool>

Now you can tell libvirt about the new storage pool and let it start automatically.

$ virsh pool-define /etc/libvirt/storage/vg1.xml
$ virsh pool-start vg1
$ virsh pool-autostart vg1
$ virsh pool-info vg1

Creating virtual machines inside that storage pool is easy as pie:

$ virt-install -d --hvm --vnc --name=vm01 \
    --ram 512 --disk pool=vg1,size=10,bus=virtio,cache=none \
    --network network=default,model=virtio \
    --location=http://ftp.debian.org/debian/dists/squeeze/main/installer-amd64/ \
    --os-type=linux --os-variant=debiansqueeze

Cheers!

Upgrade from Debian Etch/Xen 3.0 to Debian Lenny/Xen 3.2 (AMD64)

April 13, 2009 · in How-Tos, Linux, Server

I was running a Xen server with Debian Etch as dom0 (Linux 2.6.18-6 with Xen 3.0.3-1 on AMD64) for some time now. Today, I decided to upgrade the dom0 to Debian Lenny (Linux 2.6.26-2 with Xen 3.2.1-2). The domUs are all running a Debian-based OS (3x Lenny, 1x Ubuntu Hardy). The upgrade was quite straightforward, however there were some pitfalls you can avoid in advance.

(more…)

Debootstrap a Ubuntu Hardy DomU on a Debian Etch Xen Dom0

October 3, 2008 · in How-Tos, Linux, Server

Lately, I wanted set up a Ubuntu Hardy DomU on an existing Debian Etch Dom0 box. Usually, setting up Debian-based DomUs is very simple with xen-create-image and debootstrap (there are tons of tutorials out there dealing with this topic), but unfortunately Etch’s version of debootstrap doesn’t support Ubuntu Hardy. I spent a surprisingly long time on searching the net until I found a solution for this problem on a french site: Installer et configurer Xen sur Debian 4.0 Etch (it’s a complete howto for Xen on Debian Etch, but it deals with the Hardy part too). The author created a backport of the debootstrap package, which enables you to debootstrap Hardy.

First, you have to create the hardy.d directory (symlink) for xen-tools.

$ cd /usr/lib/xen-tools
$ ln -s ubuntu.d hardy.d

There’s a debian repository holding the backport package, however I got problems to use that repository on an amd64 box, so I downloaded and installed the package manually.

$ wget http://falcon.landure.fr/pool/etch/debootstrap/debootstrap_1.0.10_all.deb
$ dpkg -i debootstrap_1.0.10_all.deb

Now you should be able to debootstrap a Hardy DomU.

$ xen-create-image 
--hostname=hardy 
--ip=xxx.xxx.xxx.xxx 
--size=5Gb 
--memory=256Mb 
--dist=hardy 
--mirror=http://archive.ubuntu.com/ubuntu/
github github github

Search

Categories

  • Android
  • Development
  • Fun
  • General
  • Hardware
  • How-Tos
  • Kitchen
  • Linux
  • No Comment
  • Projects
  • Server
  • Snippets
  • Software
  • Video
  • Web
  • Windows
  • Wordpress

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Copyright © 2008-2013 mafflog