Difference between revisions of "FreeBSD Guest Notes"

From Proxmox VE
Jump to navigation Jump to search
(Update to FreeBSD 9.3, FreeBSD has now Virtio drivers, remoce deprecated Information)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]
Tweaks and tips for better performance with FreeBSD on KVM.
+
Setting up a FreeBSD Guest on PVE.
 +
:'''Note:''' This has been tested with FreeBSD 10.3 RELEASE (and patch levels). Some steps have been removed as they have been deprecated in newer FreeBSD versions.
  
:'''Note:''' This has been tested with FreeBSD 9.3 RELEASE (and patch levels). Some steps have been removed as they have been deprecated in newer FreeBSD versions.
 
 
==Create VM==
 
==Create VM==
* Download the FreeBSD 9.3-RELEASE-amd64 DVD ISO (from [http://www.freebsd.org/where.html here]) and transfer it to your VM server.
+
* Download the FreeBSD 10.3-RELEASE-amd64 DVD ISO (from [http://www.freebsd.org/where.html here]) and transfer it to your VM server.
 
* Create a new VM:
 
* Create a new VM:
** CPU: dual-socket or dual-core
+
** CPU: dual-socket and/or dual-core
*** '''IMPORTANT:''' As of current PVE releases, you may need to set your CPU to '''qemu64''' rather than '''kvm64''' for FreeBSD to be able to boot.
 
 
** RAM: 2GB (minimum)
 
** RAM: 2GB (minimum)
** Network: Intel e1000 (bridged) or Virtio
+
** Network: Virtio
** Create a 32GB primary disk (scsi, qcow2) or Virtio
+
** Disk: 32GB (or higher), virtio, qcow2
** Add FreeBSD 9.1-RELEASE-amd64 DVD ISO as an optical drive (scsi).
+
** Add FreeBSD 10.3-RELEASE-amd64 DVD ISO as an optical drive.
  
 
==Install FreeBSD==
 
==Install FreeBSD==
 
* Power on the VM.
 
* Power on the VM.
* It should boot to the FreeBSD 9.1-RELEASE-amd64 DVD ISO.
+
* It should boot to the FreeBSD 10.3-RELEASE-amd64 DVD ISO.
* System Components: Add "src".
+
* System Components: Disable optional (games, etc).
* Disks: Guided, use entire disk.
+
* Disks: Auto (ZFS) Guided Root-on-ZFS, stripe virtual device, choose vtbd0 VirtIO Block Device.
* Network: Use ipv4 only (unless you also use ipv6).
+
* Network: Choose vtnet0 VirtIO Networking Adapter. Use ipv4 only (unless you also use ipv6).
 
* Services: Add ntpd.
 
* Services: Add ntpd.
* This should leave you with FreeBSD 9.1-RELEASE installed on the 32GB primary drive.
+
* This should leave you with FreeBSD 10.3-RELEASE installed on the primary drive.
 
* Shut down the VM after installation.
 
* Shut down the VM after installation.
 
* Remove the ISO from the VM's optical drive (set to empty).
 
* Remove the ISO from the VM's optical drive (set to empty).
Line 27: Line 26:
 
==First Boot==
 
==First Boot==
 
* Power on the VM and log in.
 
* Power on the VM and log in.
If you have choosed to use VirtIO devices you can check their existence with dmesg:
 
<pre>
 
dmesg | egrep '(vtnet|vtblk)'
 
vtblk0: <VirtIO Block Adapter> on virtio_pci1
 
vtblk0: 16384MB (33554432 512 byte sectors)
 
vtnet0: <VirtIO Networking Adapter> on virtio_pci2
 
vtnet0: Ethernet address: b2:ae:f1:97:36:52
 
</pre>
 
 
* Set the time:
 
* Set the time:
 
<pre>
 
<pre>
Line 45: Line 36:
 
</pre>
 
</pre>
 
* Reboot
 
* Reboot
 
== Links ==
 
* [http://www.freebsd.org/doc/handbook/updating-upgrading-portsnap.html FreeBSD Handbook - Portsnap: a Ports Collection Update Tool]
 
* [http://www.freebsd.org/cgi/url.cgi?ports/ports-mgmt/portmaster/pkg-descr freebsd.org - Port description for ports-mgmt/portmaster]
 

Latest revision as of 20:43, 27 April 2016

Setting up a FreeBSD Guest on PVE.

Note: This has been tested with FreeBSD 10.3 RELEASE (and patch levels). Some steps have been removed as they have been deprecated in newer FreeBSD versions.

Create VM

  • Download the FreeBSD 10.3-RELEASE-amd64 DVD ISO (from here) and transfer it to your VM server.
  • Create a new VM:
    • CPU: dual-socket and/or dual-core
    • RAM: 2GB (minimum)
    • Network: Virtio
    • Disk: 32GB (or higher), virtio, qcow2
    • Add FreeBSD 10.3-RELEASE-amd64 DVD ISO as an optical drive.

Install FreeBSD

  • Power on the VM.
  • It should boot to the FreeBSD 10.3-RELEASE-amd64 DVD ISO.
  • System Components: Disable optional (games, etc).
  • Disks: Auto (ZFS) Guided Root-on-ZFS, stripe virtual device, choose vtbd0 VirtIO Block Device.
  • Network: Choose vtnet0 VirtIO Networking Adapter. Use ipv4 only (unless you also use ipv6).
  • Services: Add ntpd.
  • This should leave you with FreeBSD 10.3-RELEASE installed on the primary drive.
  • Shut down the VM after installation.
  • Remove the ISO from the VM's optical drive (set to empty).
  • Verify the VM's boot order is set to the primary hard disk first.

First Boot

  • Power on the VM and log in.
  • Set the time:
ntpdate -s pool.ntp.org
  • Update the system:
freebsd-update fetch
freebsd-update install
  • Reboot