查看你的硬件是否支持虚拟化

 egrep '(vmx|svm)' /proc/cpuinfo

安装 apt-get install kvm  相关的组件都会安装上,比较简单。


创建虚拟机镜像文件(例子为创建一个2G大小,名字是xx的文件)

 kvm-img create xx.img 2G

安装虚拟机系统

 kvm -drive file=xx.img -cdrom /path/to/boot-media.iso -boot d -m 512

我测试下来,需要有图形界面的支持,不然会 提示

Could not initialize SDL(No available video device) - exiting

加上参数

-vga std -k en-us -vnc :1 

kvm -drive file=xxx.img -cdrom DEEPIN-LITEXP-6.2.iso -boot d -m 1024 -vga std -k en-us -vnc :1 

也是可以安装的,会默认启动一个vnc服务,可以通过vnc客户端远程操作安装



 配置网桥 

修改/etc/network/interfaces


auto lo 
iface lo inet loopback


 auto eth0
 iface eth0 inet manual 
 up ifconfig $IFACE 0.0.0.0 up
 down ifconfig $IFACE down 
 tunctl_user stack   
 
 auto tap0
 iface tap0 inet manual
 up ifconfig $IFACE 0.0.0.0 up
 down ifconfig $IFACE down 
 tunctl_user stack 
 
 auto br0 
 iface br0 inet static 
 bridge_ports eth0 tap0
 address 192.168.20.230
 netmask 255.255.255.0
 network 192.168.20.0
 broadcast 192.168.20.255
 gateway 192.168.20.254
 bridge_stp off
 bridge_maxwait 0
 bridge_fd 0