First you need to install some dependencies
dkms
build-essential
linux-headers-“yourversion here” (to know your version type “uname -r”)
in my case it is 2.6.35-22-generic
uname -r 2.6.35-22-generic
注意替换成你自己的版本
To install dependencies
sudo apt-get install dkms build-essential linux-headers-2.6.35-22-generic
Now from my second computer I open my web browser, went to virtualbox.org, click on downloads, linux, and right click on the one corresponding to my linux (in my case is Ubuntu 10.10 maverik i386) and copy the link. Now open putty, ssh to the server, authenticate. Now type wget space and paste the link previously copied, hit enter.
可以去官方下载最新版本,根据自己电脑情况选择32bit还是64bit
wget http://download.virtualbox.org/virtualbox/4.0.0/virtualbox-4.0_4.0.0-69151~Ubuntu~maverick_i386.deb
Now install virtualbox 4.0.0
sudo dpkg -i virtualbox-4.0_4.0.0-69151~Ubuntu~maverick_i386.deb
第一次执行会失败,提示你缺少X窗口相关依赖,执行下面的语句,安装依赖,即使安装了因为没有GNOME也不能运行。
if it ask for some dependencies do the following: (perryg was helping me to complete my setup and he recommend me to use the “–nox11” when installing virtualbox but I didn’t have that right so I installed all the dependencies and it works)
If you know how to put –nox11 good luck if not the do the following, this will install some X packages but they will be ignored.
sudo apt-get -f install
edited :: When you run “sudo apt-get -f install” it should install the dependencies and then virtualbox setup, If the VBox setup does not Start.
Then run the installation again. 上面安装好依赖后,再次执行:
sudo dpkg -i virtualbox-4.0_4.0.0-69151~Ubuntu~maverick_i386.deb
After that you have Virtualbox headless installed but you need to add the Extension Pack in order to have vrde and usb support.
First download the Extension Pack
wget http://download.virtualbox.org/virtualbox/4.0.2/Oracle_VM_VirtualBox_Extension_Pack-4.0.2-69518.vbox-extpack
(note that this link is for the 4.0.2 and I installed the 4.0.0, this is only informational you should change all of the command according with your linux version and VirtualBox version that you want to install. So if you install Vbox 4.0.0 you should install ExtcPack 4.0.0 or if you install VBox 4.0.2 you should install ExtcPack 4.0.2).
to install it type: VBoxManage extpack install “the name of the extension Pack file”
for example
可能会因为权限问题,执行出错,前面加sudo
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.0.2-69518.vbox-extpack
Now yo can create configure and add vrde capabilities to your VMs.
建议现在有UI的环境配置好虚拟机,然后上传。
1、注册虚拟机:
VBoxManage registervm ~/win2003/win2003.vbox
2、启动虚拟机:
vboxmanage startvm ~/win2003/win2003.vbox -type headless
注意无UI的server需要加参数 -type headless,否则会提示错误。