Full-service Internet Marketing & Web Development
Recent Posts

Sponsors
![]() |
How to run FreeBSD on Windows using VMware ServerMichel Nadeau, 09-15-2009 |
In a recent post, we explained how to run FreeBSD on Windows using VirtualBox. Today we will show you how to achieve the same thing but using VMware Server. VirtualBox is a very nice application: it's fast, simple and lightweight; but VMware Server has some very interesting features to offer:
* It can run any number of virtual machines in the background. You don't need to keep any window opened and you can simply access your virtual machines using SSH if you wish.
* It supports any guest operating system, including 64-bit versions.
* All the administration is done via a great Web interface.
As VirtualBox, VMware Server is also 100% free. Another product that is competing VMware Server, and that is also free, is Microsoft VirtualServer. It has the same features but is harder to install, harder to use and is a lot more fragile. After months of testing, VMware Server proved to be the best on performance, stability and usability.
1. Download VMware Server
The first step is obviously to download VMware Server. Go there: http://www.vmware.com/products/server/ and click on the "Download" button on the left. You will need to register to download the software. Once you're registered and logged in, copy the "VMware Server 2 for Windows" serial number displayed in the "Licensing" section of the page and paste it somewhere - you will need it later. Then grab the "VMware Server 2" EXE image under the "Binaries" section. The file is around 500MB.
2. Install VMware Server
Installing VMware Server is very straightforward: basically, you simply run the setup file and hit next, next, next, next... without changing anything. There's no real options except which shortcuts you want to create.
At the end of the setup, you will be asked to enter your serial number. Because of the virtual network adapters VMware Server installs, you will also be required to reboot: you need to do it immediately if you want to go further in this tutorial.
3. Download FreeBSD
In this tutorial, we'll be installing FreeBSD 7.2 minimal. If you have a 64-bit CPU, download this one (amd64 release):
ftp://ftp.freebsd.org/pub/FreeBSD/re...md64-disc1.iso
If you have a 32-bit CPU, download this one (i386 release):
ftp://ftp.freebsd.org/pub/FreeBSD/re...i386-disc1.iso
The ISO file is around 600MB.
4. Create the FreeBSD Virtual Machine
Start the VMware Server Web Access using the Start Menu shortcut (called "Web Access") or use your favorite browser and go to this URL: http://127.0.0.1:8308/ui/
Log into the VMware Server Web Access using your Windows account.
The first thing to do is to add a Datastore to your VMware Server configuration. To do so, click on your machine name on the left panel and click on the "Add Datastore" link on the right panel. The Datastore is a folder where everything about virtual machines will get created and stored. Simply give it a name and specify the directory (example: name: VM, directory: d:\VM).
Click on the "Create Virtual Machine" on the right panel:
* Name the virtual machine "FreeBSD", select the Datastore you've just created and hit next.
* Choose "Other operating systems", choose "FreeBSD" (32 or 64-bit, depending on your CPU) in the combo box and hit next.
* Assign the amount of memory you want your virtual machine to have (usually the recommended amount is quite good, unless you need a high-performance virtual machine). If you have a multi-core CPU (or many CPU's), you can choose the number of CPU's you want your virtual machine to use. Hit next when you're satisfied with your settings.
* Select "Create a New Virtual Disk" and hit next.
* Choose the size you want your virtual disk to have and hit next.
* Select "Add a Network Adapter" and hit next.
* Leave the settings to "Bridged" and hit next.
* In the CD/DVD section, select "Use an ISO Image" and hit next.
* Move the FreeBSD 7.2 ISO image you've just downloaded somewhere under the directory you're using as your Datastore. Then select it and hit OK. Then hit next.
* Select "Don't Add a Floppy Drive"
* Select "Don't Add a USB Controller"
* Check "Power on your new virtual machine now" and Hit "Finish"
5. Installing FreeBSD
Now that your FreeBSD virtual machine is created, it's time to install FreeBSD! First of all, in the VMware Server Web Access, click on the FreeBSD virtual machine on the left panel. Then click on the "Console" tab on the right, and click anywhere in the black screen. A small console window will popup: that's your FreeBSD machine, just like if you were sitting in front of a computer running FreeBSD.
NOTE: the console window "steals the focus"; at any time, press CTRL+ALT to release focus from this window. And simply click into the console window to use it.
It should boot from the ISO image you've specified in the setup: it's now time to install FreeBSD:
* Choose "United States" and hit enter.
* Choose "Standard" and hit enter.
* In the Disk Geometry screen, hit "a", then "q".
* Choose "BootMgr" and hit enter.
* In the Partition screen, hit "a", then "q".
* In the "Choose Distributions" screen, select "Minimal" and hit space to check it. Then hit tab, then enter on the OK button.
* Choose CD/DVD and hit enter. The base system will install.
* Network:
Hit "yes" to configure network.
Choose the "em0" network interface.
Hit "yes" to configure using DHCP.
Enter an hostname and hit enter many times.
Choose "no" to use this machine as a gateway.
Hit "no" to enable inetd.
Hit "yes" to enable SSH.
Hit "no" to anonymous FTP.
Hit "no" to NFS server.
Hit "no" to NFS client.
* Last settings:
Hit "no" to customize console.
Hit "yes" to timezone and choose your timezone.
Hit "no" to PS/2.
Hit "no" to package collection.
Hit "no" to create a user.
Set the "root" password.
Hit "no" to visit the options menu.
At the main menu, hit tab to go to the "Exit Install" option, hit enter and then hit "yes". Close the console. In the VMware Server Web Access, select the FreeBSD Virtual Machine on the left panel and hit the red "stop" sign at the top. Then hit the green "play" sign and return in the console. Your FreeBSD system should boot normally.
6. Mounting a shared folder using Samba
It's very convenient to be able to easily and quickly share files between your Windows and FreeBSD machine.
First of all, share a folder on your Windows machine (ex: share). It can be any folder, just share it normally. Then choose a mount point for that folder on your FreeBSD (ex: /mnt/share). We're now going to configure your FreeBSD machine so the shared folder will be automatically mounted at boot time.
Here's the sample informations (replace with yours):
Windows machine: win
Windows IP addr: 192.168.0.100
Windows share: share
Windows user: administrator
Windows password: mypass
FreeBSD mount point: /mnt/share (do not forget to create the directory!)
In /etc/nsmb.conf, add:
NOTE: the caps are important
Then in /etc/fstab, add:
NOTE: before rebooting FreeBSD to test, I recommend testing the mounting manually with a command like this:
Finally, reboot your FreeBSD machine and then go check in your mount point (like /mnt/share) if it works! Try creating folders from FreeBSD and from Windows and verify if it's working correctly. If it's not, the problem is probably on the authentication side.
7. Starting the virtual machine automatically
One other great VMware Server feature is the ability to start virtual machines automatically when you boot Windows.
To configure this, in the VMware Server Web Access, click on your Windows machine name on the left panel, and then click on "Edit Virtual Machine Startup/Shutdown Settings". Select your FreeBSD virtual machine and click "Move Up" to put it in the "Any Order" category.
Conclusion
You now have a FreeBSD virtual machine, acting just like if it was a real server sitting somewhere in your house! Virtual machines are great for development and testing. Please let me know if you have any problems getting this tutorial working!
* It can run any number of virtual machines in the background. You don't need to keep any window opened and you can simply access your virtual machines using SSH if you wish.
* It supports any guest operating system, including 64-bit versions.
* All the administration is done via a great Web interface.
As VirtualBox, VMware Server is also 100% free. Another product that is competing VMware Server, and that is also free, is Microsoft VirtualServer. It has the same features but is harder to install, harder to use and is a lot more fragile. After months of testing, VMware Server proved to be the best on performance, stability and usability.
1. Download VMware Server
The first step is obviously to download VMware Server. Go there: http://www.vmware.com/products/server/ and click on the "Download" button on the left. You will need to register to download the software. Once you're registered and logged in, copy the "VMware Server 2 for Windows" serial number displayed in the "Licensing" section of the page and paste it somewhere - you will need it later. Then grab the "VMware Server 2" EXE image under the "Binaries" section. The file is around 500MB.
2. Install VMware Server
Installing VMware Server is very straightforward: basically, you simply run the setup file and hit next, next, next, next... without changing anything. There's no real options except which shortcuts you want to create.
At the end of the setup, you will be asked to enter your serial number. Because of the virtual network adapters VMware Server installs, you will also be required to reboot: you need to do it immediately if you want to go further in this tutorial.
3. Download FreeBSD
In this tutorial, we'll be installing FreeBSD 7.2 minimal. If you have a 64-bit CPU, download this one (amd64 release):
ftp://ftp.freebsd.org/pub/FreeBSD/re...md64-disc1.iso
If you have a 32-bit CPU, download this one (i386 release):
ftp://ftp.freebsd.org/pub/FreeBSD/re...i386-disc1.iso
The ISO file is around 600MB.
4. Create the FreeBSD Virtual Machine
Start the VMware Server Web Access using the Start Menu shortcut (called "Web Access") or use your favorite browser and go to this URL: http://127.0.0.1:8308/ui/
Log into the VMware Server Web Access using your Windows account.
The first thing to do is to add a Datastore to your VMware Server configuration. To do so, click on your machine name on the left panel and click on the "Add Datastore" link on the right panel. The Datastore is a folder where everything about virtual machines will get created and stored. Simply give it a name and specify the directory (example: name: VM, directory: d:\VM).
Click on the "Create Virtual Machine" on the right panel:
* Name the virtual machine "FreeBSD", select the Datastore you've just created and hit next.
* Choose "Other operating systems", choose "FreeBSD" (32 or 64-bit, depending on your CPU) in the combo box and hit next.
* Assign the amount of memory you want your virtual machine to have (usually the recommended amount is quite good, unless you need a high-performance virtual machine). If you have a multi-core CPU (or many CPU's), you can choose the number of CPU's you want your virtual machine to use. Hit next when you're satisfied with your settings.
* Select "Create a New Virtual Disk" and hit next.
* Choose the size you want your virtual disk to have and hit next.
* Select "Add a Network Adapter" and hit next.
* Leave the settings to "Bridged" and hit next.
* In the CD/DVD section, select "Use an ISO Image" and hit next.
* Move the FreeBSD 7.2 ISO image you've just downloaded somewhere under the directory you're using as your Datastore. Then select it and hit OK. Then hit next.
* Select "Don't Add a Floppy Drive"
* Select "Don't Add a USB Controller"
* Check "Power on your new virtual machine now" and Hit "Finish"
5. Installing FreeBSD
Now that your FreeBSD virtual machine is created, it's time to install FreeBSD! First of all, in the VMware Server Web Access, click on the FreeBSD virtual machine on the left panel. Then click on the "Console" tab on the right, and click anywhere in the black screen. A small console window will popup: that's your FreeBSD machine, just like if you were sitting in front of a computer running FreeBSD.
NOTE: the console window "steals the focus"; at any time, press CTRL+ALT to release focus from this window. And simply click into the console window to use it.
It should boot from the ISO image you've specified in the setup: it's now time to install FreeBSD:
* Choose "United States" and hit enter.
* Choose "Standard" and hit enter.
* In the Disk Geometry screen, hit "a", then "q".
* Choose "BootMgr" and hit enter.
* In the Partition screen, hit "a", then "q".
* In the "Choose Distributions" screen, select "Minimal" and hit space to check it. Then hit tab, then enter on the OK button.
* Choose CD/DVD and hit enter. The base system will install.
* Network:
Hit "yes" to configure network.
Choose the "em0" network interface.
Hit "yes" to configure using DHCP.
Enter an hostname and hit enter many times.
Choose "no" to use this machine as a gateway.
Hit "no" to enable inetd.
Hit "yes" to enable SSH.
Hit "no" to anonymous FTP.
Hit "no" to NFS server.
Hit "no" to NFS client.
* Last settings:
Hit "no" to customize console.
Hit "yes" to timezone and choose your timezone.
Hit "no" to PS/2.
Hit "no" to package collection.
Hit "no" to create a user.
Set the "root" password.
Hit "no" to visit the options menu.
At the main menu, hit tab to go to the "Exit Install" option, hit enter and then hit "yes". Close the console. In the VMware Server Web Access, select the FreeBSD Virtual Machine on the left panel and hit the red "stop" sign at the top. Then hit the green "play" sign and return in the console. Your FreeBSD system should boot normally.
6. Mounting a shared folder using Samba
It's very convenient to be able to easily and quickly share files between your Windows and FreeBSD machine.
First of all, share a folder on your Windows machine (ex: share). It can be any folder, just share it normally. Then choose a mount point for that folder on your FreeBSD (ex: /mnt/share). We're now going to configure your FreeBSD machine so the shared folder will be automatically mounted at boot time.
Here's the sample informations (replace with yours):
Windows machine: win
Windows IP addr: 192.168.0.100
Windows share: share
Windows user: administrator
Windows password: mypass
FreeBSD mount point: /mnt/share (do not forget to create the directory!)
In /etc/nsmb.conf, add:
NOTE: the caps are important
[WIN]
addr=192.168.0.100
[WIN:ADMINISTRATOR]
password=mypass
addr=192.168.0.100
[WIN:ADMINISTRATOR]
password=mypass
Then in /etc/fstab, add:
//administrator@win/share /mnt/share smbfs rw 0 0
NOTE: before rebooting FreeBSD to test, I recommend testing the mounting manually with a command like this:
mkdir -p /mnt/tmp
mount_smbfs //administrator@win/share /mnt/tmp
mount_smbfs //administrator@win/share /mnt/tmp
Finally, reboot your FreeBSD machine and then go check in your mount point (like /mnt/share) if it works! Try creating folders from FreeBSD and from Windows and verify if it's working correctly. If it's not, the problem is probably on the authentication side.
7. Starting the virtual machine automatically
One other great VMware Server feature is the ability to start virtual machines automatically when you boot Windows.
To configure this, in the VMware Server Web Access, click on your Windows machine name on the left panel, and then click on "Edit Virtual Machine Startup/Shutdown Settings". Select your FreeBSD virtual machine and click "Move Up" to put it in the "Any Order" category.
Conclusion
You now have a FreeBSD virtual machine, acting just like if it was a real server sitting somewhere in your house! Virtual machines are great for development and testing. Please let me know if you have any problems getting this tutorial working!
![]() |
Liviu Olos, 12-01-2009 |
In nginx.conf, make sure you have:
sendfile off;
-
Otherwise Samba will not work properly
sendfile off;
-
Otherwise Samba will not work properly
|
|
Subscribe Now to receive new posts via Email as soon as they come out.
Comments
Post your comments


