NetBSD 6 on KVM

From ezUnix
Jump to: navigation, search
                                    pdf_icon.png Download this article as a single PDF document 

Introduction

KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux and Solaris (SmartOS) on x86 hardware containing virtualization extensions (Intel VT or AMD-V).
Installing NetBSD as a KVM guest is straight forward and does not require any work arounds.


Installation

First you need to install KVM on your Linux server. This HowTo will not cover that part.
You should also install virt-manager to be able to easily administrate your virtual guests using a GUI interface.


Get the ISO

Next fetch an installation iso from your local NetBSD mirror.
In my case it's

ftp1.uninett.no:/pub/NetBSD/NetBSD-6.0/iso/NetBSD-6.0-amd64.iso


Install NetBSD

You can either install to a block device such as an LVM device or to a disk container.
Installing to a raw device will result in a better performance.


Install to LVM

# virt-install -c qemu:///system --virt-type kvm --name name_of_your_virtual_host --ram 2048 --disk \
path=/dev/VG_NAME/beasty,bus=virtio,size=50 --network bridge:br0 --cdrom NetBSD-6.0-amd64.iso --vcpus 2 \
--accelerate --noautoconsole --graphics vnc

Install to disk container

# virt-install -c qemu:///system --virt-type kvm --name name_of_your_virtual_host --ram 2048 --disk \ 
path=/virtual/netbsd/name_of_your_virtual_host.img,bus=virtio,size=50 --network bridge:br0 \
--cdrom NetBSD-6.0-amd64.iso --vcpus 2 --accelerate --noautoconsole --graphics vnc


Most of the knobs are self explanatory. The --disck path option will define where to install to - a raw device or a disk image.
The --cdrom option defines the ISO image to use for installation. The --vcpus knob defines how many CPUs to assign to the guest.

Run

# virt-install --help

to see all the available options.

Console

Use your local vnc viewer or type the following at server itself to view installer screen:

# vncviewer

OR run it over the ssh session, enter:

# ssh -X -C root@kvmserver
# virt-viewer name_of_your_virtual_host

Or run virt-manager either locally or over ssh.



That's all folks.
Marcin


<comments />
Talk:NetBSD 6 on KVM