Author: NetDemon
Email: netdemon@20cn.net
Http://www.20cn.net/
This article is copyrighted by the network security team of 20CN and can be reproduced, but it must maintain the integrity of the article and indicate the source
FreeBSD has not had any available and officially supported virtualization solutions over the past few years. Only the old version of VMware3 running on the Linux binary compatibility layer has been shut down and started. Shortly after the release of FreeBSD 7.2, Sun's Open Source Edition OSE VirtualBox emerged as a FreeBSD native program in the Ports Collection. VirtualBox is a very active open-source virtualization software that can be used in most operating systems, including Windows, Mac OS, Linux, and FreeBSD. Windows or UNIX can also be run as the customer system.
Next we will install VirtualBox and run a Windows2003. these operations are performed on a remote FreeBSD system without the X graphical interface.
First, upgrade VirtualBox in Ports to version 3.1.2. (At the time of this article, VirtualBox officially has version 3.1.4. You may have updated version 3.1.4)
# Portsnap fetch update
Compile VirtualBox,
# Cd/usr/ports/emulators/virtualbox-ose-kmod & make
# Cd ../virtualbox-ose & make
If the compilation is successful, uninstall the previously installed VirtualBox (if any)
# Pkg_delete virtualbox -*
Install VirtualBox
# Cd ../virtualbox-ose-kmod & make install clean
# Cd ../virtualbox-ose & make install clean
Configure VirtualBox
Add in/boot/loader. conf
Vboxdrv_load = "YES"
Add in/etc/rc. conf
Vboxnet_enable = "YES"
Restart the system
# Shutdown-r now
(!!! If the vboxdrv fails to be loaded, the FreeBSD kernel needs to be upgraded to 8.0 or later)
Create a Windows Virtual Machine
$ VBoxManage createvm-name Win2003-register
Disk space required to create a virtual machine
$ VBoxManage createhd-filename Win2003.vdi-size 10000-variant Standard
Create storage controllers and Virtual CD/DVD devices required by virtual machines
$ VBoxManage storagectl Win2003-name "IDE Controller"-add ide-controller PIIX4
Add disk devices to virtual machines
$ VBoxManage storageattach Win2003-storagectl "IDE Controller"-port 0-device 0-type hdd-medium Win2003.vdi
Mount the ISO file for system installation
$ VBoxManage storageattach Win2003-storagectl "IDE Controller"-port 0-device 1-type dvddrive-medium/home/netdemon/test/win2003setupdics. iso
Configure the Virtual Machine NIC (bridging mode ):
$ VBoxManage modifyvm Win2003-nic1 bridged-cableconnected1 on-bridgeadapter1 fxp0 (this is the name of your actual physical Nic In ifconfig)
Okay. All the configurations have been completed. You can start the VM.
$ VBoxManage startvm Win2003-type headless
So, is it started? Obviously, we cannot expect to see a graphical interface on an SSH client.
$ Ps-aux
If you see that a VBox * process is running, congratulations. This indicates that your configuration is correct. If not
$ Cat/your user directory/. VirtualBox/Machines/Win2003/Logs/VBox. log
See where the configuration is wrong. Make changes based on your actual situation until you can see the VBox * process.
However, even if the virtual machine runs correctly, Win2003 on the virtual machine is still running normally. Why? Is it not installed yet? Is it the Win2003 system? In the current condition, win2003setupdics. the iso installation CD is the key to success or failure. It must be an installation CD that has been properly prepared and configured according to your actual conditions. In this case, after you start the virtual machine, it will automatically install Win2003. then you can access Win2003 through the Remote Desktop, Which is why 2003 is selected, because it is 3389 by default. How to make such a CD is not the scope of this article, there are a lot of relevant information on the Internet. As a work und, we can also install VirtualBox on a local machine, such as WinXP, and install and configure the virtual Win2003 on the GUI, then upload the installed win2003.vdi virtual hard disk file to overwrite the one on FreeBSD.
By now, the virtual Windows2003 is completely working normally. Through the 3389 connection, you will never feel that you are operating a virtual machine. This article is re-edited under this virtual Win2003. Before that, I installed a QQ here and seduce a little girl in a group ....
PS:
If you do not notice that the command prompt before creating the virtual machine is # And the command prompt after creating the virtual machine is $. That means you are not smart enough. Yes, this virtual machine can run without the root permission, which means that even if a hacker is smarter than you, he has hacked your Win2003 and formatted your hard disk, then you will destroy your BIOS. You are still in good condition, and all actions that are smarter than you will become stupid.