debian vbox设置_Debian 8.0下安装配置VirtualBox
一、添加VirtualBox源
deb https://download.virtualbox.org/virtualbox/debian jessie contrib
二、安装VirtualBox
# cd /data/src
# wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | apt-key add -
# wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | apt-key add -
# apt-get update
# apt-get -y install virtualbox-6.0
// 如果有提示缺少headers则安装相应的包
# apt-get -y install linux-headers-amd64 linux-headers-3.16.0-7-amd64
# /sbin/vboxconfig
三、安装扩展包,支持vrde
// 创建硬盘
# VBoxManage createhd --filename /data/vbox/win2003.vdi --size 100000
// 创建一个虚拟机
# VBoxManage createvm --name win2003 --ostype Windows2003 --register
// 添加网卡,设置远程桌面、启动顺序
# VBoxManage modifyvm win2003 --memory 1000 --nic1 bridged --nictype1 Am79C970A --bridgeadapter1 eth0 --ioapic on --boot1 dvd --boot2 disk --vrde on --vrdeport 3300
// 添加硬盘和光驱
# VBoxManage storagectl win2003 --name "IDE Controller" --add ide
# VBoxManage storageattach win2003 --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium /data/vbox/win2003.vdi
# VBoxManage storageattach win2003 --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /data/src/win2003sp2.iso
// 添加远程桌面帐号
# VBoxManage modifyvm win2003 --vrdeauthtype external --vrdeauthlibrary VBoxAuthSimple
# VPASS=$(VBoxManage internalcommands passwordhash abc123)
# VBoxManage setextradata win2003 VBoxAuthSimple/users/koven ${VPASS#*: }
// 设置共享文件夹
# VBoxManage sharedfolder add win2003 --name share --hostpath /data/share
// 启动虚拟机,安装系统
# VBoxManage startvm win2003 --type headless
// 关闭虚拟机
# VBoxManage controlvm win2003 poweroff
// 安装VirtualBox驱动
# VBoxManage storageattach win2003 --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /usr/share/virtualbox/VBoxGuestAdditions.iso
# VBoxManage modifyvm win2003 --boot1 disk --boot2 dvd