/etc/init.d/vboxdrv setup
2,复制vdi文件
VBoxManage clonevdi old new
3,收缩虚拟磁盘
sdelete -c c:\ #win 清零磁盘分区
???? #linux 下不知道还
VBoxManage modifyvdi "Windows XP.vdi" compact
???? #linux 下不知道还
VBoxManage modifyvdi "Windows XP.vdi" compact
4,目录共享
VBoxManage sharedfolder add "VM name" -name "sharename" -hostpath "sharepath"
net use x: \\vboxsvr\sharename #win
mount -t vboxsf "sharepath" #linux
net use x: \\vboxsvr\sharename #win
mount -t vboxsf "sharepath" #linux
5,使用USB
vim /etc/fstab # 1002 is the USB group ID
none /proc/bus/usb usbfs devgid=1002,devmode=664 0 0
none /proc/bus/usb usbfs devgid=1002,devmode=664 0 0
6,使用物理磁盘
VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/HardDisks/UsbDisk.vmdk -rawdisk /dev/sda -partitions 1 -relative -register
7,网络
1),NAT
VBoxManage.exe" setextradata "guest_name" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/link_name/Protocol" TCP
VBoxManage.exe" setextradata "guest_name" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/link_name/GuestPort" 80
VBoxManage.exe" setextradata "guest_name" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/link_name/HostPort" 80
VBoxManage.exe" setextradata "guest_name" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/link_name/GuestPort" 80
VBoxManage.exe" setextradata "guest_name" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/link_name/HostPort" 80
2),Bridge
chmod 666 /dev/net/tun
tunctl -t tap0 -u `whoami`
brctl addbr br0
ifconfig tap0 0.0.0.0 promisc
ifconfig eth0 0.0.0.0 promisc
brctl addif br0 tap0
brctl addif br0 eth0
ifconfig tap0 up
ifconfig eth0 up
ifconfig br0 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255
route add default gw 192.168.1.1
tunctl -t tap0 -u `whoami`
brctl addbr br0
ifconfig tap0 0.0.0.0 promisc
ifconfig eth0 0.0.0.0 promisc
brctl addif br0 tap0
brctl addif br0 eth0
ifconfig tap0 up
ifconfig eth0 up
ifconfig br0 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255
route add default gw 192.168.1.1