[root@yumc]# wget https://download.virtualbox.org/virtualbox/5.2.18/Oracle_VM_VirtualBox_Extension_Pack-5.2.18.vbox-extpack [root@yumc]# VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.2.18.vbox-extpack Do you agree to these license terms and conditions (y/n)? y
License accepted. For batch installaltion add --accept-license=56be48f923303c8cababb0bb4c478284b688ed23f16d775d729b89a2e8e5f9eb to the VBoxManage command line. 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Successfully installed "Oracle VM VirtualBox Extension Pack".
VBoxManage modifyvm xp --boot1 dvd VBoxManage modifyvm xp --boot1 disk
设置网卡(可以用多种模式 这里用的是桥接)
1 2 3 4 5 6 7
VBoxManage modifyvm xp \ --nic1 bridged \ --cableconnected1 on \ --nictype1 82540EM \ --bridgeadapter1 enp2s0 \ --intnet1 brigh1 \ --macaddress1 auto
开启远程桌面(可以设置端口)
如果打开这个功能 但是本地没有监听端口或者连不上 请检查扩展第一步扩展是否安装完成!!!
1 2
VBoxManage modifyvm xp --vrde on VBoxManage modifyvm xp --vrdeport 3900
设置内存
1
VBoxManage modifyvm xp --memory 1024
启动虚拟机 下列两个命令都可以启动
1
VBoxManage startvm xp --type headless
1
VBoxHeadless -s xp &
克隆虚拟机
1
VBoxManage clonevm xp
操作虚拟机(暂停 恢复 重启 关机 保存状态)
1 2 3 4 5
VBoxManage controlvm xp pause VBoxManage controlvm xp resume VBoxManage controlvm xp reset VBoxManage controlvm xp poweroff VBoxManage controlvm xp savestate
WARNING: The vboxdrv kernel module is not loaded. Either there is no module available for the current kernel (3.10.0-862.el7.x86_64) or it failed to load. Please recompile the kernel module and install it by
sudo /sbin/vboxconfig
You will not be able to start VMs until this problem is fixed.