手上的機器有 10Gb 以上的網卡,但是虛擬機的虛擬網卡只能模擬到 1Gb
為了讓虛擬機能用到 10Gb ,於是查到可以直接 Assign PCI device 給虛擬機使用
目前測試 qemu 是 ok 的,另外 CPU 也要有支援 VT-d 才行
# enable Intel IOMMU in kernel and BIOS MUST enable Virtualizaion
sudo vim /etc/default/grub
add "intel_iommu=on"
sudo update-grub
sudo reboot
# Create qcow image
qemu-img create -f qcow2 test.qcow 10G
# Download pciestub script from GitHub
wget https://raw.githubusercontent.com/smilejay/kvm-book/master/scripts/pcistub.sh
chomd u+x pcistub.sh
# use lspci to find PCIE address
sudo ./pcistub.sh -h <PCIE address>
# Install OS to VM
# e.q. sudo qemu-system-x86_64 -m 16384 -smp 8 -boot order=cd -hda ./test.qcow -cdrom ./ubuntu-16.04.iso -device pci-assign,host=84:00.0,id=mynic --enable-kvm -vnc :1
sudo qemu-system-x86_64 -m <memory in MB> -smp <number of CPU> -boot order=<1st boot device> -hda <first disk> -cdrom <ISO file of Ubuntu > -device pci-assign,host=<PCI Address>,id=<Custom Device Name> --enable-kvm -vnc :1
# Launch VM with Intel IOMMU in kernel and output in VNC
# e.q. sudo qemu-system-x86_64 -m 16384 -smp 8 -hda ./test.qcow -device pci-assign,host=84:00.0,id=mynic --enable-kvm -vnc :1
# vnc :1 means port 5901, vnc :2 means port 5902, ...etc.
sudo qemu-system-x86_64 -m <memory in MB> -smp <number of CPU> -hda <first disk> -device pci-assign,host=<PCI Address>,id=<Custom Device Name> --enable-kvm -vnc :1
為了讓虛擬機能用到 10Gb ,於是查到可以直接 Assign PCI device 給虛擬機使用
目前測試 qemu 是 ok 的,另外 CPU 也要有支援 VT-d 才行
# enable Intel IOMMU in kernel and BIOS MUST enable Virtualizaion
sudo vim /etc/default/grub
add "intel_iommu=on"
sudo update-grub
sudo reboot
# Create qcow image
qemu-img create -f qcow2 test.qcow 10G
# Download pciestub script from GitHub
wget https://raw.githubusercontent.com/smilejay/kvm-book/master/scripts/pcistub.sh
chomd u+x pcistub.sh
# use lspci to find PCIE address
sudo ./pcistub.sh -h <PCIE address>
# Install OS to VM
# e.q. sudo qemu-system-x86_64 -m 16384 -smp 8 -boot order=cd -hda ./test.qcow -cdrom ./ubuntu-16.04.iso -device pci-assign,host=84:00.0,id=mynic --enable-kvm -vnc :1
sudo qemu-system-x86_64 -m <memory in MB> -smp <number of CPU> -boot order=<1st boot device> -hda <first disk> -cdrom <ISO file of Ubuntu > -device pci-assign,host=<PCI Address>,id=<Custom Device Name> --enable-kvm -vnc :1
# Launch VM with Intel IOMMU in kernel and output in VNC
# e.q. sudo qemu-system-x86_64 -m 16384 -smp 8 -hda ./test.qcow -device pci-assign,host=84:00.0,id=mynic --enable-kvm -vnc :1
# vnc :1 means port 5901, vnc :2 means port 5902, ...etc.
sudo qemu-system-x86_64 -m <memory in MB> -smp <number of CPU> -hda <first disk> -device pci-assign,host=<PCI Address>,id=<Custom Device Name> --enable-kvm -vnc :1
留言