FreeNAS 8 under KVM

FreeNAS 8 runs nicely under Linux KVM virtualisation. But unlike FreeNAS 7, FreeNAS 8 is based on FreeBSD 8.2. This means that there are some configuration differences. The main one is the network device model type='ne2k_pci' does not seem to work for FreeBSD 8.2 or FreeNAS 8.

So if you're having trouble getting the networking to work, try using model type='rtl8139'. And you will need at least 1GB for the OS drive, otherwise the installation will fail silently.

Below is a working scripted install that we used on one of our lab computers to successfully install FreeNAS 8 using KVM. NB: Install FreeNAS onto the smaller disk (ad0), which is the second one in the list shown during installation. You will need to adjust the script as necessary for your setup:



lvcreate -n lv_${NAME}_os -L 1G vg_vm && \
lvcreate -n lv_${NAME}_storage -L ${DISK}G vg_vm && \
virt-install \
  -n${NAME}  \
  -r 2048 \
  --vcpus=2 \
  --autostart \
  --os-type unix \
  --hvm \
  --os-variant=freebsd7 \
  --accelerate \
  -v \
  --network bridge=br0,model=rtl8139 \
  --disk path=/dev/vg_vm/lv_${NAME}_os \
  --disk path=/dev/vg_vm/lv_${NAME}_storage \
  -c ${ISO} \
  --vnc --vnclisten=         <domain type='kvm'>

And the resulting domain config:

<domain type='kvm'>
    <type arch='x86_64' machine='pc-0.12'>hvm</type>
    <boot dev='hd'/>
  <clock offset='utc'/>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/vg_vm/lv_freenas8-node01_os'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/vg_vm/lv_freenas8-node01_storage'/>
      <target dev='hdb' bus='ide'/>
      <address type='drive' controller='0' bus='0' unit='1'/>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdc' bus='ide'/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    <interface type='bridge'>
      <mac address='52:54:00:e1:8b:47'/>
      <source bridge='br0'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    <serial type='pty'>
      <target port='0'/>
    <console type='pty'>
      <target type='serial' port='0'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='' keymap='en-us'/>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>

— Andrew

Next entry

Previous entry

Related entries

Similar entries


  1. TooMeeK
    TooMeeK on 06/26/2011 10:31 p.m.

    Hello, just installing same machine under KVM. I'm not new to KVM, but now I'm trying to reach.. 2Gbit from Client to VM which is FreeNAS 8 32bit.
    I have Win7x64 client with 2xGigabit LACP bridged cards (onboard and Intel PRO/1000 Fiber teamed by Intel's software) and also the hypervisor uses bond0 for bridge br0 with 2 NICs: onboard and Intel PRO/1000 F, both LACP. But only on Debian VM Virtio NIC can be used to reach ~890Mbits for single NIC. And also I see none of BONDING modes work for VMs like FreeNAS. :(
    Any ideas how to reach at least 2Gbit??


Pingbacks are open.

Post your comment

Site theme originally by