前提:宿主机需要支持虚拟化,如果未打开,则需要重启机器,在bois中打开该项;
sudo modprobe kvm
sudo modprobe kvm-intel
qemu-img create -f qcow2 virtualdisk.img 50G
kvm -hda virtualdisk.img -cdrom cdrom.iso -m 256 -net nic -net user -soundhw all kvm -drive file=xxxx.img -cdrom /path/to/boot-media.iso -boot d -m 1024
kvm
kvm-intel
kvm
kvm-amd
kvm -m 1024 -drive file=Ubuntu_x86-64_14.04_50GB.vmdk kvm -m 1024 -drive file=xp.img -cdrom /home/cat650/linux/kvm/NETKVM-20081229.iso -enable-kvm -net nic,model=virtio -net user
cd D:\Program Files (x86)\WorkTools\Oracle\VirtualBox
VBoxManage.exe clonehd "D:\VirtualBox VMs\Ubuntu_x86-64_14.04_Template\Ubuntu_x86-64_14.04_50GB.vdi" "D:\VirtualBox VMs\Ubuntu_x86-64_14.04_Template\Ubuntu_x86-64_14.04_50GB.vmdk " -format VMDK
D:\Program Files (x86)\WorkTools\Oracle\VirtualBox>VBoxManage.exe clonehd "D:\VirtualBox VMs\VM_VMDK\Ubuntu_x86-64_14.04_50GB.vdi" "D:\VirtualBox VMs\VM_VMDK\Ubuntu_x86-64_14.04_50GB.vmdk " -format VMDK VBoxManage.exe: error: Cannot register the hard disk 'D:\VirtualBox VMs\VM_VMDK\Ubuntu_x86-64_14.04_50GB.vdi' {3c0592d1-9991-4a05-8da5-b004be55c1fd} because a hard disk 'D:\VirtualBox VMs\Ubuntu_x86-64_14.04_Template\Ubuntu_x86-64_14.04_Template.vdi' with UUID {3c0592d1-9991-4a05-8da5-b004be55c1fd} already exists VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component VirtualBox, interface IVirtualBox, callee IUnknown VBoxManage.exe: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 178 of file VBoxManageDisk.cpp
VBoxManage.exe clonehd "D:\VirtualBox VMs\Ubuntu_x86-64_14.04_Template\Ubuntu_x86-64_14.04_50GB.vdi" "D:\VirtualBox VMs\Ubuntu_x86-64_14.04_Template\Ubuntu_x86-64_14.04_50GB.vmdk " -format VMDK VBoxManage.exe clonehd "D:\VirtualBox VMs\VM_VMDK\Ubuntu_x86-64_14.04_50GB.vdi" "D:\VirtualBox VMs\VM_VMDK\Ubuntu_x86-64_14.04_50GB.vmdk " -format VMDK
cd D:\Program Files (x86)\WorkTools\Oracle\VirtualBox
VBoxManage.exe clonehd "C:\Users\HaoChuang\VirtualBox VMs\Ubuntu_x86-64_14.04_50GB\Ubuntu_x86-64_14.04_50GB.vdi" "C:\Users\HaoChuang\VirtualBox VMs\Ubuntu_x86-64_14.04_50GB.vmdk " -format VMDK
set x=vhi set y=vmdk echo off & cls for /f "delims=" %%a in ('dir /b/a-d %~dp0') do ( setlocal enabledelayedexpansion set source=%%a if /i "!source:~-4!"==".%x%" ( set target=!source:~0,-4!.%y% "%VBOX_INSTALL_PATH%VBoxManage.exe" clonehd "%~dp0!source!" "%~dp0!target!" --format %y% ))