但是我在使用VirtualBox時,可能已經創造出一個虛擬機器OK了。
然後我要利用這個虛擬機器VDI檔,再使用來開成另一個同樣環境的OS。
好省去我重複安裝OS的那些步驟和時間,要怎麼做呢?
之前我以為用指令cp就可以了!
没想到要掛上我cp出來的VDI檔時,VirtualBox卻給我錯誤訊息,
提示說什麼uuid已經重複!同樣的VDI已經被註冊使用了!
耶?之前用過VMWare可沒有這種困擾啊,幹麻VirtualBox要這麼嚴謹。
後來無意中打字,打VBox用上了bash的命令補完功能時,
出現了一連串沒看過的VirtualBox的指令集,然後又找了Google大師解惑。
才知道,原來VirtualBox這個套自由軟體,還是有遵照自由軟體的老傳統......
是有文字模式的命令集的。
而它的VDI要複製再使用,就是要用它的命令功具來執行才行!
唉!這下有解了。
我不用為了要以一個Pure的OS環境,去Try一些Server功能,
然後辛苦的從頭安裝一個OS了。
$ VBoxManage clonevdi Win2003Server.vdi Win2003.vdi
就能把原來裝好windows 2003 Server產生的VDI檔Win2003Server.vdi,
複製成Win2003.vdi,然後掛載成一個新的虛擬機器用了。
當然,你要先把虛擬機器停掉,再來「克隆」哦!
轉貼一下它的說明,以為備查:
VirtualBox Command Line Management Interface Version 1.5.4
(C) 2005-2007 innotek GmbH
All rights reserved.
Usage:
VBoxManage [-v|-version] print version number and exit
VBoxManage -nologo ... suppress the logo
VBoxManage list vms|ostypes|hostdvds|hostfloppies|
hdds|dvds|floppies|usbhost|usbfilters|
systemproperties
VBoxManage showvminfo <uuid>|<name>
[-details]
VBoxManage registervm <filename>
VBoxManage unregistervm <uuid>|<name>
[-delete]
VBoxManage createvm -name <name>
[-register]
[-basefolder <path> | -settingsfile <path>]
VBoxManage modifyvm <uuid|name>
[-name <name>]
[-ostype <ostype>]
[-memory <memorysize>]
[-vram <vramsize>]
[-acpi on|off]
[-ioapic on|off]
[-hwvirtex on|off|default]
[-monitorcount <number>]
[-bioslogofadein on|off]
[-bioslogofadeout on|off]
[-bioslogodisplaytime <msec>]
[-bioslogoimagepath <imagepath>]
[-biosbootmenu disabled|menuonly|messageandmenu]
[-biossystemtimeoffset <msec>]
[-biospxedebug on|off]
[-boot<1-4> none|floppy|dvd|disk|net>]
[-hd<a|b|d> none|<uuid>|<filename>]
[-dvd none|<uuid>|<filename>|host:<drive>]
[-dvdpassthrough on|off]
[-floppy disabled|empty|<uuid>|
<filename>|host:<drive>]
[-nic<1-N> none|null|nat|hostif|intnet]
[-nictype<1-N> Am79C970A|Am79C973]
[-cableconnected<1-N> on|off]
[-nictrace<1-N> on|off]
[-nictracefile<1-N> <filename>]
[-hostifdev<1-N> none|<devicename>]
[-intnet<1-N> <network>]
[-macaddress<1-N> auto|<mac>]
[-uart<1-N> off|<I/O base> <IRQ>]
[-uartmode<1-N> disconnected|
server <pipe>|
client <pipe>|
<devicename>]
[-tapsetup<1-N> none|<application>]
[-tapterminate<1-N> none|<application>]
[-audio none|null|oss|alsa]
[-clipboard disabled|hosttoguest|guesttohost|
bidirectional]
[-vrdp on|off]
[-vrdpport default|<port>]
[-vrdpaddress <host>]
[-vrdpauthtype null|external|guest]
[-vrdpmulticon on|off]
[-usb on|off]
[-usbehci on|off]
[-snapshotfolder default|<path>]
VBoxManage startvm <uuid>|<name>
[-type gui|vrdp]
VBoxManage controlvm <uuid>|<name>
pause|resume|reset|poweroff|savestate|
acpipowerbutton|acpisleepbutton|
setlinkstate<1-4> on|off |
usbattach <uuid>|<address> |
usbdetach <uuid>|<address> |
dvdattach none|<uuid>|<filename>|host:<drive> |
floppyattach none|<uuid>|<filename>|host:<drive> |
setvideomodehint <xres> <yres> <bpp> [display]|
setcredentials <username> <password> <domain>
[-allowlocallogon <yes|no>]
VBoxManage discardstate <uuid>|<name>
VBoxManage snapshot <uuid>|<name>
take <name> [-desc <desc>] |
discard <uuid>|<name> |
discardcurrent -state|-all |
edit <uuid>|<name>|-current
[-newname <name>]
[-newdesc <desc>] |
showvminfo <uuid>|<name>
VBoxManage registerimage disk|dvd|floppy <filename>
[-type normal|immutable|writethrough] (disk only)
VBoxManage unregisterimage disk|dvd|floppy <uuid>|<filename>
VBoxManage showvdiinfo <uuid>|<filename>
VBoxManage createvdi -filename <filename>
-size <megabytes>
[-static]
[-comment <comment>]
[-register]
[-type normal|writethrough] (default: normal)
VBoxManage modifyvdi <uuid>|<filename>
compact
VBoxManage clonevdi <uuid>|<filename> <outputfile>
VBoxManage convertdd <filename> <outputfile>
VBoxManage convertdd stdin <outputfile> <bytes>
VBoxManage addiscsidisk -server <name>|<ip>
-target <target>
[-port <port>]
[-lun <lun>]
[-encodedlun <lun>]
[-username <username>]
[-password <password>]
[-comment <comment>]
VBoxManage getextradata global|<uuid>|<name>
<key>|enumerate
VBoxManage setextradata global|<uuid>|<name>
<key>
[<value>] (no value deletes key)
VBoxManage setproperty vdifolder default|<folder> |
machinefolder default|<folder> |
vrdpauthlibrary default|<library> |
hwvirtexenabled yes|no
loghistorycount <value>
VBoxManage usbfilter add <index,0-N>
-target <uuid>|<name>|global
-name <string>
-action ignore|hold (global filters only)
[-active yes|no] (yes)
[-vendorid <XXXX>] (null)
[-productid <XXXX>] (null)
[-revision <IIFF>] (null)
[-manufacturer <string>] (null)
[-product <string>] (null)
[-remote yes|no] (null, VM filters only)
[-serialnumber <string>] (null)
[-maskedinterfaces <XXXXXXXX>]
VBoxManage usbfilter modify <index,0-N>
-target <uuid>|<name>|global
[-name <string>]
[-action ignore|hold] (global filters only)
[-active yes|no]
[-vendorid <XXXX>|""]
[-productid <XXXX>|""]
[-revision <IIFF>|""]
[-manufacturer <string>|""]
[-product <string>|""]
[-remote yes|no] (null, VM filters only)
[-serialnumber <string>|""]
[-maskedinterfaces <XXXXXXXX>]
VBoxManage usbfilter remove <index,0-N>
-target <uuid>|<name>|global
VBoxManage sharedfolder add <vmname>|<uuid>
-name <name> -hostpath <hostpath>
[-transient]
VBoxManage sharedfolder remove <vmname>|<uuid>
-name <name> [-transient]
VBoxManage updatesettings [<dir>|<file>] [-apply]
[-nobackup] [-skipinvalid]
5 則留言:
挑個小錯
$ VBoxMange clonevdi Win2003Server.vdi Win2003.vdi
應該是VBoxManage...
謝謝指教!
知錯要能改...
真是的,讓無知的我試了好久好久,強烈建議修改一下
請問要在那裡下這指令呢? 謝謝你的指導
謝謝你的分享,我找到下指令的部份,已順利解決複製的問題!
張貼留言