Contenu connexe
Similaire à VBoxManage tutorial (10)
Plus de Bhuridech Sudsee (20)
VBoxManage tutorial
- 1. 4 Ways to Manage VirtualBox
1) VirtualBox ใชงานผาน Graphic User Interface (GUI) แบบที่ใชงานตามปกติ
2) VBoxManage ใชงานผาน Command Line Interface (CLI) สามารถสั่งงานผาน
Command เลยสะดวกในการทำงานอัตโนมัติ
3) VBoxSDL ใชงานผานกราฟฟกแบบงายๆ (ไมมี Config ใหเลือก)
4) VBoxHeadless ใชงานผาน Command Line Interface (CLI) โหมดนี้จะทำตัวเปน
RDP Server [1]
- 2. VBoxManage --type headless VS. VBoxHeadless
ควรใช VBoxHeadless แทน VBoxManage --type headless เพราะดูขอผิดพลาดได และ
VBoxHeadless มีคา default เปน force start VRDE (VirtualBox Remote Desktop
Extension) ทำให Remote ไปที่ VM instance ได [2] เปน Remote ในระดับ Machine
ไมตองรอ OS พรอมทำให Config บางอยางได เชนเขา Safe mode
- ตองติดตั้ง Extensions ใน Host VM เพิ่ม
- VBoxManage ก็ทำของคลายกันไดแตเพิ่มคำสั่ง
- การใช VRDE ตอง Remote ไปที่ IP ของ Host VM (Default port : 3389)
- 3. Create new VM
VBoxManage createvm --name [ชื่อ VM] --register
* สรางแลวตอง register ดวย ไมงั้นจะไมเห็นในระบบ (แตสั่ง Register ทีหลังผาน VBoxManage
registervm '[Full path]' ก็ได)
- 4. List of VMs
VBoxManage list vms
จะพบ ชื่อ VM ภายในเครื่องหมายอัญประกาศ (Quote) และ UUID ของ VM
ในวงเล็บปกกา (Curly braces)
- 6. Modify VM
VBoxManage modifyvm [ชื่อ VM] [option] [option parameters]
Ex.
VBoxManage modifyvm HomeWork --memory 512
Example options :
--name [new name]
--ostype [new ostype]
--usb [on/off]
--memory [new memory size in MB]
etc.
- 7. Create virtual disk
VBoxManage createhd --filename [ชื่อ HD] --size [ขนาด HD]
Binding virtual harddisk drive
1) VBoxManage storagectl [ชื่อ VM] --name [ชื่อตัวควบคุม]--add sata
Ex. VBoxManage storagectl HomeWork --name HWDriver --add sata
VBoxManage storageattach [ชื่อ VM] --storagectl HWDriver --type HDD
2) --port 0 --device 0 --medium [Disk full path]
Ex. VBoxManage storageattach HomeWork --storagectl HWDriver --type HDD
--port 0 --device 0 --medium /Users/dekcom/HWData.vdi
- 8. Binding virtual dvd-drive
Ex. VBoxManage storageattach HomeWork --storagectl HWDriver --type DVDDRIVE
--port 1 --device 0 --medium /Users/dekcom/Downloads/ubuntu-14.04.2-server-
amd64.iso [3]
Start VM
VBoxHeadless --startvm HomeWork
(ถาอยากใหทำงานเปน Background process ใสเวนวรรคแลวใส & ขางหลัง)
- 9. Control VM
VBoxManage controlvm [ชื่อ VM] [option] [option parameters]
Ex. VBoxManage controlvm HomeWork acpipowerbutton
Example options :
pause
resume
poweroff
draganddrop [disabled/hosttoguest]
etc.
- 10. Clone VM
VBoxManage clonevm [ชื่อ VM ตนแบบ] --name [ชื่อ VM ใหม] --register
Ex. VBoxManage clonevm HomeWork --name HomeWork2 --register
VBoxManage unregistervm [ชื่อ VM] --delete
Ex. VBoxManage unregistervm HomeWork2 --delete
Delete VM