User Tools

Site Tools


docs:guide-user:virtualization:qemu

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:guide-user:virtualization:qemu [2018/06/13 20:17]
bobafetthotmail [Experiences: openwrt virtualized using debian, qemu/kvm and a lex twitter system with intel atom d525 and chipset ich8m]removed weirdness in links
docs:guide-user:virtualization:qemu [2018/06/15 07:40] (current)
bobafetthotmail moved paragraph to networking part of the article
Line 166: Line 166:
   * ''​eth0'',​ used as LAN in OpenWrt, and connected to ''​ledetap0''​ in host system(static address ''​192.168.1.101/​24''​),​ providing access to LUCI at ''​http://​192.168.1.1'' ​   * ''​eth0'',​ used as LAN in OpenWrt, and connected to ''​ledetap0''​ in host system(static address ''​192.168.1.101/​24''​),​ providing access to LUCI at ''​http://​192.168.1.1'' ​
   * ''​eth1'',​ used as WAN in OpenWrt, and connected to qemu that will proxy all TCP/UDP connections towards the Internet   * ''​eth1'',​ used as WAN in OpenWrt, and connected to qemu that will proxy all TCP/UDP connections towards the Internet
 +
 +==== Use KVM igb network interfaces ====
 +(taken from mailing list post by Philip Prindeville)
 +
 +On my Centos 7.4 KVM host, I did:
 +
 +To provision 10 VF’s per NIC:
 +
 +<​code>​
 +cat <<​__EOF__ > /​etc/​modprobe.d/​sr-iov.conf
 +# for SR-IOV support
 +options igb max_vfs=10
 +__EOF__
 +
 +</​code>​
 +this will take effect after the next reboot… or by unloading and reloading the IGB module.
 +
 +Create XML files for each NIC you want to support virtualization on:
 +
 +<​code>​
 +# cat <<​__EOF__ > /​tmp/​hostdev-net0.xml
 +<​network>​
 +  <​name>​hostdev-net0</​name>​
 +  <​uuid>​$(uuidgen)</​uuid>​
 +  <forward mode='​hostdev'​ managed='​yes'>​
 +    <pf dev='​eno1'/>​
 +  </​forward>​
 +</​network>​
 +__EOF__
 +
 +# cat <<​__EOF__ > /​tmp/​hostdev-net1.xml
 +<​network>​
 +  <​name>​hostdev-net1</​name>​
 +  <​uuid>​$(uuidgen)</​uuid>​
 +  <forward mode='​hostdev'​ managed='​yes'>​
 +    <pf dev='​eno2'/>​
 +  </​forward>​
 +</​network>​
 +__EOF__
 +# ...
 +
 +</​code>​
 +
 +Make Qemu aware of them:
 +
 +<​code>​
 +# virsh net-destroy default
 +
 +# virsh net-define /​tmp/​hostdev-net0.xml
 +# virsh net-autostart hostdev-net0
 +
 +# virsh net-define /​tmp/​hostdev-net1.xml
 +# virsh net-autostart hostdev-net1
 +# …
 +</​code>​
 +
 +to create the pool of VF interfaces.
 +
 +Then to add interfaces to VM’s, I did:
 +
 +<​code>​
 +# cat <<​__EOF__ > /​tmp/​new-interface-0.1.xml
 +<​interface type='​network'>​
 +  <mac address='​52:​54:​00:​0d:​84:​f4'/>​
 +  <source network='​hostdev-net0'/>​
 +  <address type='​pci'​ domain='​0x0000'​ bus='​0x07'​ slot='​0x10'​ function='​0x0'/>​
 +</​interface>​
 +__EOF__
 +
 +</​code>​
 +
 +where the ‘0d:​84:​f4’ is 3 unique bytes… I got them from:
 +<​code>​
 +dd status=none bs=1 count=3 if=/​dev/​urandom | hexdump -e ‘/1 “%x”\n"​
 +</​code>​
 +I think.
 +
 +Then to bind an interface to a VM, I did:
 +<​code>​
 +# virsh attach-device my-machine-1 /​tmp/​new-interface-0.1.xml
 +</​code>​
  
 ===== Advanced boot methods ===== ===== Advanced boot methods =====
Line 201: Line 282:
  lkvm stop --all  lkvm stop --all
  
- +===== A Practical Example ====== 
- +This example uses openwrt virtualized using debian, qemu/kvm and a lex twitter system with intel atom d525 and chipset ich8m.
-===== Experiences: ​openwrt virtualized using debian, qemu/kvm and a lex twitter system with intel atom d525 and chipset ich8m  ​======+
 Normally openwrt works on most of the hardware mentioned in the table of hardware Normally openwrt works on most of the hardware mentioned in the table of hardware
 (search in this wiki), and also on most of the hardware that support **intel x86 ISA** or  (search in this wiki), and also on most of the hardware that support **intel x86 ISA** or 
docs/guide-user/virtualization/qemu.1528921067.txt.gz · Last modified: 2018/06/13 20:17 by bobafetthotmail