VirtualBox命令列建立虛擬機器及無法啟動虛擬機器時問題處理

VirtualBox命令列建立虛擬機器及無法啟動虛擬機器時問題處理

環境 win7

在path里加入virtual box路徑

建立虛擬機器

VBoxManage.exe createvm --name xie1 --register

這裡寫圖片描述

修改記憶體及作業系統

VBoxManage.exe modifyvm vm_name --memory 1024 --vram 64 --acpi on --boot1 dvd  --ostype "Linux"

OSType值列表

ID:          Other
Description: Other/Unknown
ID:          Windows31
Description: Windows 3.1
ID:          Windows95
Description: Windows 95
ID:          Windows98
Description: Windows 98
ID:          WindowsMe
Description: Windows Me
ID:          WindowsNT4
Description: Windows NT 4
ID:          Windows2000
Description: Windows 2000
ID:          WindowsXP
Description: Windows XP
ID:          WindowsXP_64
Description: Windows XP (64 bit)
ID:          Windows2003
Description: Windows 2003
ID:          Windows2003_64
Description: Windows 2003 (64 bit)
ID:          WindowsVista
Description: Windows Vista
ID:          WindowsVista_64
Description: Windows Vista (64 bit)
ID:          Windows2008
Description: Windows 2008
ID:          Windows2008_64
Description: Windows 2008 (64 bit)
ID:          Windows7
Description: Windows 7
ID:          Windows7_64
Description: Windows 7 (64 bit)
ID:          WindowsNT
Description: Other Windows
ID:          Linux22
Description: Linux 2.2
ID:          Linux24
Description: Linux 2.4
ID:          Linux24_64
Description: Linux 2.4 (64 bit)
ID:          Linux26
Description: Linux 2.6
ID:          Linux26_64
Description: Linux 2.6 (64 bit)
ID:          ArchLinux
Description: Arch Linux
ID:          ArchLinux_64
Description: Arch Linux (64 bit)
ID:          Debian
Description: Debian
ID:          Debian_64
Description: Debian (64 bit)
ID:          OpenSUSE
Description: openSUSE
ID:          OpenSUSE_64
Description: openSUSE (64 bit)
ID:          Fedora
Description: Fedora
ID:          Fedora_64
Description: Fedora (64 bit)
ID:          Gentoo
Description: Gentoo
ID:          Gentoo_64
Description: Gentoo (64 bit)
ID:          Mandriva
Description: Mandriva
ID:          Mandriva_64
Description: Mandriva (64 bit)
ID:          RedHat
Description: Red Hat
ID:          RedHat_64
Description: Red Hat (64 bit)
ID:          Turbolinux
Description: Turbolinux
ID:          Turbolinux
Description: Turbolinux (64 bit)
ID:          Ubuntu
Description: Ubuntu
ID:          Ubuntu_64
Description: Ubuntu (64 bit)
ID:          Xandros
Description: Xandros
ID:          Xandros_64
Description: Xandros (64 bit)
ID:          Oracle
Description: Oracle
ID:          Oracle_64
Description: Oracle (64 bit)
ID:          Linux
Description: Other Linux
ID:          Solaris
Description: Solaris legacy
ID:          Solaris_64
Description: Solaris legacy (64 bit)
ID:          OpenSolaris
Description: Solaris modern (S10U8 )
ID:          OpenSolaris_64
Description: Solaris modern (S10U8 ) (64 bit)
ID:          FreeBSD
Description: FreeBSD
ID:          FreeBSD_64
Description: FreeBSD (64 bit)
ID:          OpenBSD
Description: OpenBSD
ID:          OpenBSD_64
Description: OpenBSD (64 bit)
ID:          NetBSD
Description: NetBSD
ID:          NetBSD_64
Description: NetBSD (64 bit)
ID:          OS2Warp3
Description: OS/2 Warp 3
ID:          OS2Warp4
Description: OS/2 Warp 4
ID:          OS2Warp45
Description: OS/2 Warp 4.5
ID:          OS2eCS
Description: eComStation
ID:          OS2
Description: Other OS/2
ID:          MacOS
Description: Mac OS X Server
ID:          MacOS_64
Description: Mac OS X Server (64 bit)
ID:          DOS
Description: DOS
ID:          Netware
Description: Netware
ID:          L4
Description: L4
ID:          QNX
Description: QNX
ID:          JRockitVE
Description: JRockitVE

設定硬碟(100G自動增長)

VBoxManage.exe createhd --filename D:/vbox/CentOS64/disk_name.vdi  --size 102400

增加IDE 控制器

VBoxManage.exe storagectl xie1 --name "IDE Controller" --add ide --bootable on

掛載

VBoxManage.exe storageattach xie1 --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium D:/vbox/CentOS64/disk1.vdi
VBoxManage.exe storageattach xie1 --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium "D:/BaiduYunDownload/CentOS-7.0-1406-x86_64-Everything.iso" 

設定網絡卡

VBoxManage.exe modifyvm xie1 --nic1 hostonly --nic2 bridged
VBoxManage.exe modifyvm xie1 --hostonlyadapter1 "VirtualBox Host-Only Ethernet Adapter" --bridgeadapter2 "Realtek PCIe GBE Family Controller"

這裡寫圖片描述

啟動

VBoxManage.exe startvm xie1

virtual box啟動虛擬機器時一個問題處理

提示:
不能為虛擬電腦**開啟一個新任務。

在貼吧看到解決方案:
http://tieba.baidu.com/p/3420800826
還原uxtheme.dll檔案。
注意替換前要把c:/windows/system32下原有的uxtheme.dll改名。

clone

VboxManage clonehd centos1/centos1.vdi centos6/centos6.vdi

直接複製虛擬機器以後可能會出現找不到網絡卡,處理方法:
首先看一下這裡的網絡卡MAC地址:
這裡寫圖片描述

然後修改:
/etc/sysconfig/network-scripts/ifcfg-eth0 中的HWADDR 引數與上面保持一致。

有時候出現網路不可達,或Network is unreachable,參考:
http://blog.csdn.net/xundh/article/details/46618233?locationNum=1&fps=1#t28