ubuntu安装kvm

sudo apt-get install kvm,libvirt-bin,virt-manager;

kvm-img create ubuntu1.img 2G
kvm-img create ubuntu1.img 80G -f qcow2

/usr/bin/kvm -S -M pc-1.0 -enable-kvm -m 1024 -smp 4,sockets=4,cores=1,threads=1 -name v1 -uuid e20788fc-1746-1d9f-9a71-a2932c1f3133 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/v1.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -drive file=/data/kvmimg/ubuntu2.img,if=none,id=drive-ide0-0-0,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive file=/data/downloads/ubuntu-12.04-server-amd64.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=20,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:c4:8d:98,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:0 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
 

kvm -M pc -m 256 -hda /data/kvmimg/ubuntu1.img -net nic -net user -usb -localtime -vnc 127.0.0.1:0 -daemonize -redir tcp:3389::3389 -boot d
 

查看cpu是否支持虚拟化

grep -E '(vmx|svm)'   /proc/cpuinfo

查看是否加载了kvm模块

lsmod | grep kvm

原创文章,转载请注明: 转载自海波无痕

本文链接地址: ubuntu安装kvm

文章的脚注信息由WordPress的wp-posturl插件自动生成

此条目发表在server分类目录,贴了, 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

评论链接可以 移除 nofollow.