使用qemu-kvm建立一个虚拟机,然后虚拟机的线程绑定到具体的一个cpu的核上
环境,centos6.5,双核,
1,在主机上修改grub,把主机的核隔离
2.使用taskset 把qemu的线程绑定到隔离的核上。
打开vmware或者bios的cpu的VT
kvm在/usr/libexec/qemu-kvm
新建一个硬盘
第一次使用iso新建系统
第二次就不用iso了
如果模拟具体某种cpu
看支持的cpu
启动之后用vnc连上去
ctrl+alt+2 切换到qemu
info cpus
info kvm
[img]http://dl2.iteye.com/upload/attachment/0109/8611/c1571c24-9b4a-3208-b4f6-4332e63ec74f.jpg[/img]
修改grup,然后重启主机,
[code="java"]
# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all ker
环境,centos6.5,双核,
1,在主机上修改grub,把主机的核隔离
2.使用taskset 把qemu的线程绑定到隔离的核上。
yum install glib2 glib2-devel libtool gcc-c++ gcc zlib zlib-devel flex bison
lsmod |grep kvm
ls -l /dev/kvm
打开vmware或者bios的cpu的VT
kvm在/usr/libexec/qemu-kvm
新建一个硬盘
dd if=/dev/zero of=rhel65.img bs=1M count=8192
第一次使用iso新建系统
/usr/libexec/qemu-kvm -m 2048 -smp 2 -boot order=cd -hda /root/kvm/rhel65.img -cdrom /root/kvm/CentOS-6.5-x86_64.iso
第二次就不用iso了
/usr/libexec/qemu-kvm -m 2048 -smp 2 -boot order=cd -hda /root/kvm/rhel65.img -vnc 192.168.137.188:1 &
如果模拟具体某种cpu
/usr/libexec/qemu-kvm -cpu SandyBridge -m 2048 -smp 2 -boot order=cd -hda /root/kvm/rhel65.img -vnc 192.168.137.188:1 -daemonize
看支持的cpu
/usr/libexec/qemu-kvm -cpu ?
启动之后用vnc连上去
ctrl+alt+2 切换到qemu
info cpus
info kvm
[img]http://dl2.iteye.com/upload/attachment/0109/8611/c1571c24-9b4a-3208-b4f6-4332e63ec74f.jpg[/img]
修改grup,然后重启主机,
[code="java"]
# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all ker