alforno

Setup a FreeBSD VM Using Oracle's VirtualBox

Jan 28th, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.21 KB | None | 0 0
  1. Setup a FreeBSD VM Using Oracle's VirtualBox
  2. Written by: Alforno
  3.  
  4. FreeBSD is an open source Unix-like OS that has been around for more than thirty years. Oracle's VM Virtual Box makes it easy to run FreeBSD as a virtual machine, but FreeBSD will not install with VirtualBox's default settings.
  5.  
  6. This guide was written to provide a baseline VM setup that can run FreeBSD. The installation of FreeBSD is not shown here, but it can be seen on the original full install guide. This guide includes additional technical details and information that was not given in the original full install guide, which was meant to be a quick and dirty step-by-step guide..
  7.  
  8. Let's get started.
  9.  
  10.  
  11. Install Oracle VM Virtual Box
  12.  
  13. If you don't already have it, download and install Oracle's VM Virtual Box software. For this guide I will be using version 4.3.6 running on Windows 7 Professional.
  14.  
  15. You can download virtual box here.
  16. https://www.virtualbox.org/wiki/Downloads
  17.  
  18. We won't be showing step-by-step install instructions for Virtual Box here.
  19.  
  20.  
  21. Setup the virtual machine
  22.  
  23. Run Virtual Box and create a new virtual machine.
  24.  
  25. Type in a name, I used "mybsd" for this guide.
  26.  
  27. For Type select BSD and for Version select FreeBSD or FreeBSD (64 bit), depending on your processor type. It is easy to make a mistake here if you're not paying attention. Just remember to select the 64 bit version if you have a 64 bit install. Click the Next button.
  28.  
  29. The next step is to set the amount of memory you'd like the VM to have. According to the FreeBSD documentation, FreeBSD/i386 and FreeBSD/pc98 require at least 24 MB of RAM for the most minimal installation. For this guide we will be allocating 1024 MB. Click the Next button.
  30.  
  31. This guide assumes that are you going to be installing a fresh copy of FreeBSD to the VM, if that is the case then select Create a virtual hard drive now. If you already have an existing virtual hard drive file then you could select Use an existing virtual hard drive file and then select the file. Click the Next button.
  32.  
  33. Select the VDI (VirtualBox Disk Image) hard drive file type. The other file formats are provided for compatibility with other virtualization software such as VMware and Microsoft's Virtual PC. Click the Next button.
  34.  
  35. Select Dynamically allocated. This results in FreeBSD being able to use a large virtual drive without requiring all of the space to be allocated initially. If you want to use the Fixed size, then be prepared to wait while VirtualBox creates the virtual disk. The benefit of using a fixed size is that it can increase disk i/o performance. Click the Next button.
  36.  
  37. You can name your hard drive file and select its location. I'm leaving the default name and location. If you have an SSD then you could increase performance by storing your virtual drive file on that SSD drive.
  38.  
  39. Set the virtual hard drive file size to 50 GB. You may be able to get away with a bit less space but you may run into problems during installation. If you are creating a fixed size virtual drive then be prepared to wait while the file is created. The larger the drive size, the longer the wait. Click the Create button. Once the create process completes, you will see your new FreeBSD VM in the list of available VMs. Before we can install FreeBSD we must first configure some additional settings.
  40.  
  41.  
  42. Additional virtual machine settings
  43.  
  44. There are a few other settings we need to change in order to make this work. We are not going to go over every default setting, only the settings that we might want to change.
  45.  
  46. Select the new virtual machine and open its settings. Select the System settings and then the Motherboard tab.
  47.  
  48. FreeBSD will install and run on both the PIIX3 and ICH9 chipsets. The more modern ICH9 supports PCI express, three PCI buses, PCI-to-PCI bridges and Message Signaled Interrupts (MSI), but according to the VirtualBox documentation the ICH9 support is "experimental and not recommended for guest operating systems which do not require it". For this guide we will be setting the chipset to PIIX3 and the Pointing Device to PS/2 Mouse.
  49.  
  50. If you are installing a 64 bit version of FreeBSD, or you want to enable more than one virtual processor, make sure to check Enable I/O APIC. The documentation for VirtualBox explains that I/O APIC support can slow down your guest OS slightly.
  51.  
  52. The last thing to enable is the Hardware Clock in UTC Time. This isn't absolutely necessary, since FreeBSD will let you choose during installation, but it is typical for Unix-like operating systems to have the hardware clock report the time in UTC format.
  53.  
  54.  
  55. Select the Processor tab.
  56.  
  57. FreeBSD's SMP kernal implements symmetric multi-processor support, but may require additional kernal configuration. Select the number of processors you want your VM to have. We are using 1 processor for this guide.
  58.  
  59. Check the option for Enable PAE/NX if your BIOS and chipset supports it.
  60.  
  61. PAE is an acronym for Physical Address Extension and when checked, allows even 32 bit operating systems to access RAM over 4 GB.
  62.  
  63. The second part of the extended features, NX, is also an acronym that stands for No Execute, Enhanced Virus Protection, or Execute Never, depending on the processor type. The NX bit is often utilized as a security measure that prevents the OS from executing code residing in specific ranges of RAM.
  64.  
  65. Select the Acceleration tab. If your CPU supports it, check both Enable VT-x/AMD-V and Enable Nested Paging.
  66.  
  67. VT-x is Intel's virtualization technology and a list of supported CPUs can be found on Intel's website.
  68. http://ark.intel.com/Products/VirtualizationTechnology
  69.  
  70. AMD's virtualization technology is called AMD-V and there is a short list of supported CPU's on their website too.
  71. http://sites.amd.com/us/business/it-solutions/virtualization/Pages/client-side-virtualization.aspx
  72.  
  73. Nested Paging improves performance significantly by making use of the CPU's built-in virtual machine RAM addressing functionality. Nested Paging takes a load off of the VM's hypervisor, which would be doing these memory address translations in software, rather than hardware. There is more to it than that, but it will do for a quick explanation.
  74.  
  75. That's it for that part. We can leave the other settings at their defaults. Your VM is ready to have FreeBSD installed on it.
Advertisement
Add Comment
Please, Sign In to add comment