Difference between revisions of "FreeBSD Guest Notes"

From Proxmox VE
Jump to navigation Jump to search
Line 1: Line 1:
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]
 +
'''WARNING: This part is currently in test - it may render your system un-bootable when you make changes to your <code>/etc/fstab</code>.'''
 +
 +
This part is KVM specific, however, it is similar to installing VMWare Tools or [http://open-vm-tools.sourceforge.net/ Open VM Tools].
 +
* Install virtio-kmod:
 +
==Enable Virto==
 +
<pre>
 +
cd /usr/ports/emulators/virtio-kmod && make clean install
 +
</pre>
 +
* When prompted on each required package, accept defaults and OK.
 +
* Copy the virtio modules into <code>/boot/kernel</code> directory:
 +
<pre>
 +
cp -Rp /usr/local/modules/* /boot/kernel/
 +
kldxref /boot/kernel
 +
</pre>
 +
* Add the following to <code>/boot/loader.conf</code>:
 +
<pre>
 +
virtio_load="YES"
 +
virtio_pci_load="YES"
 +
virtio_blk_load="YES"
 +
if_vtnet_load="YES"
 +
virtio_balloon_load="YES"
 +
</pre>
 +
* Enable virtio for disk by changing your <code>/etc/fstab</code> entries to use the '''vtbd''' prefix. Example:
 +
<pre>
 +
# Device        Mountpoint      FStype  Options Dump    Pass#
 +
/dev/vtbd0p2    /              ufs    rw      1      1
 +
/dev/vtbd0p3    none            swap    sw      0      0
 +
</pre>
 +
* Enable virtio for network by changing the <code>ifconfig_em0="DHCP"</code> line in <code>/etc/rc.conf</code> to:
 +
<pre>
 +
ifconfig_vtnet0="DHCP"
 +
</pre>
 +
* Shutdown the VM
 +
<pre>
 +
shutdown -p now
 +
</pre>
 +
* Change network and disk drivers to virtio.
 +
* Power on the VM.
 +
* Verify that virtio is loading:
 +
<pre>
 +
kldstat
 +
 +
Id Refs Address            Size    Name
 +
1  12 0xffffffff80200000 11cdab0  kernel
 +
2    5 0xffffffff813ce000 4ca0    virtio.ko
 +
3    1 0xffffffff813d3000 5880    virtio_pci.ko
 +
4    1 0xffffffff813d9000 5010    virtio_blk.ko
 +
5    1 0xffffffff813df000 aeb0    if_vtnet.ko
 +
6    1 0xffffffff813ea000 3210    virtio_balloon.ko
 +
</pre>

Revision as of 21:40, 6 October 2012

WARNING: This part is currently in test - it may render your system un-bootable when you make changes to your /etc/fstab.

This part is KVM specific, however, it is similar to installing VMWare Tools or Open VM Tools.

  • Install virtio-kmod:

Enable Virto

cd /usr/ports/emulators/virtio-kmod && make clean install
  • When prompted on each required package, accept defaults and OK.
  • Copy the virtio modules into /boot/kernel directory:
cp -Rp /usr/local/modules/* /boot/kernel/
kldxref /boot/kernel
  • Add the following to /boot/loader.conf:
virtio_load="YES"
virtio_pci_load="YES"
virtio_blk_load="YES"
if_vtnet_load="YES"
virtio_balloon_load="YES"
  • Enable virtio for disk by changing your /etc/fstab entries to use the vtbd prefix. Example:
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/vtbd0p2    /               ufs     rw      1       1
/dev/vtbd0p3    none            swap    sw      0       0
  • Enable virtio for network by changing the ifconfig_em0="DHCP" line in /etc/rc.conf to:
ifconfig_vtnet0="DHCP"
  • Shutdown the VM
shutdown -p now
  • Change network and disk drivers to virtio.
  • Power on the VM.
  • Verify that virtio is loading:
kldstat

Id Refs Address            Size     Name
 1   12 0xffffffff80200000 11cdab0  kernel
 2    5 0xffffffff813ce000 4ca0     virtio.ko
 3    1 0xffffffff813d3000 5880     virtio_pci.ko
 4    1 0xffffffff813d9000 5010     virtio_blk.ko
 5    1 0xffffffff813df000 aeb0     if_vtnet.ko
 6    1 0xffffffff813ea000 3210     virtio_balloon.ko