<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2618069852664801272</id><updated>2012-02-16T21:07:03.827-06:00</updated><category term='virtualization'/><title type='text'>Binary Bit Me</title><subtitle type='html'>Expert at pretending to be a ninja</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://binarybitme.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2618069852664801272/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://binarybitme.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>binarybitme</name><uri>http://www.blogger.com/profile/04938295842357082522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2618069852664801272.post-477422089068476157</id><published>2011-09-20T19:24:00.000-05:00</published><updated>2011-09-20T19:24:48.146-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='virtualization'/><title type='text'>Using Open vSwitch with libvirt and QEMU/KVM</title><content type='html'>This is a quick and dirty write-up of using Open vSwitch(OVS) with libvirt and QEMU/KVM. I assume you already have libvirt(&lt;a href="http://libvirt.org/"&gt;http://libvirt.org&lt;/a&gt;) up and running with QEMU/KVM. Other hypervisors may work but I haven't tried them at this time.&lt;br /&gt;&lt;br /&gt;Grab the master of Open vSwitch(&lt;a href="http://openvswitch.org/"&gt;http://openvswitch.org/&lt;/a&gt;)&amp;nbsp;with git because in previous versions there is&amp;nbsp;an issue with removing ports from a fake bridge when the TAP is just deleted without first removing it from the bridge. This is what happens with libvirt and KVM when a VM is shutdown.&amp;nbsp;This is fixed in the OVS master. The fix will also be in versions 1.2.2, 1.3.0, &amp;nbsp;and later when released.&lt;br /&gt;&lt;br /&gt;1) Compile and install OVS by following INSTALL.Linux&lt;br /&gt;&lt;br /&gt;2) Compile and install OVS bridge&amp;nbsp;compatibility&amp;nbsp;mode by following INSTALL.bridge&lt;br /&gt;&lt;br /&gt;Now you should have a working OVS install with bridge&amp;nbsp;compatibility&amp;nbsp;mode.&lt;br /&gt;&lt;br /&gt;3) Create a fake bridge for each VLAN you want available. So say you have br0 as your&amp;nbsp;real bridge and you want a VLAN 101.&lt;br /&gt;&lt;br /&gt;ovs-vsctl add-br br101 br0 101&lt;br /&gt;&lt;br /&gt;This will create a fake bridge tagged with VLAN 101. Do this for every VLAN you want.&lt;br /&gt;&lt;br /&gt;4) In libvirt use a bridge interface setting the source to the appropriate fake bridge.&lt;br /&gt;&lt;br /&gt;For example if you want a virtual machine on VLAN 101 assign it to br101&lt;br /&gt;&lt;br /&gt;You can add the network interface by editing domain's XML directly with virsh.&lt;br /&gt;&lt;br /&gt;&amp;lt;interface type='bridge'&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;source bridge='br101'/&amp;gt;&lt;br /&gt;&amp;lt;/interface&amp;gt;&lt;br /&gt;&lt;br /&gt;Add this in the &amp;lt;devices&amp;gt; section. Libvirt will fill in the &amp;lt;mac/&amp;gt; and &amp;lt;address/&amp;gt;.&lt;br /&gt;&lt;br /&gt;You can also add the network interface with virt-manager.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-RwZQgPmZGEg/TnknNGqx9JI/AAAAAAAAAAM/3rwd685HTVY/s1600/bridge-interface-virt-manager.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="227" src="http://3.bp.blogspot.com/-RwZQgPmZGEg/TnknNGqx9JI/AAAAAAAAAAM/3rwd685HTVY/s320/bridge-interface-virt-manager.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Now when you boot the VM libvirt will create the TAP interface and add it to br101.&amp;nbsp;Since bridge&amp;nbsp;compatibility&amp;nbsp;mode is running OVS will add the port tagged with the appropriate VLAN when libvirt adds the interface to the bridge.&lt;br /&gt;&lt;br /&gt;After starting the VM you should see the associated TAP interface when you list the ports in OVS.&lt;br /&gt;&lt;br /&gt;ovs-vsctl list port&lt;br /&gt;&lt;br /&gt;It should have the appropriate tag. In this case the tag should be 101.&lt;br /&gt;&lt;br /&gt;Notice the port will not show up under br0 if you list-ports. You will have to list-ports on the&amp;nbsp;fake bridge&lt;br /&gt;&lt;br /&gt;ovs-vsctl list-ports br101&lt;br /&gt;&lt;br /&gt;When you shutdown the VM the TAP interface will be destroyed and the port will be removed&amp;nbsp;from OVS. If the TAP interface is destroyed, but the port still exists in OVS then you&amp;nbsp;are not using a new enough version of OVS.&lt;br /&gt;&lt;br /&gt;This will not help with mirrors or other advanced features but will give you the basic&amp;nbsp;ability to automatically add and remove ports on the virtual switch with the appropriate VLAN&amp;nbsp;tags for your virtual machines' interfaces.&lt;br /&gt;&lt;br /&gt;I am working on a helper service that will enable the ability to automatically handle mirrors and&amp;nbsp;other advanced&amp;nbsp;functionality. It will also allow you to avoid using bridge&amp;nbsp;compatibility&amp;nbsp;mode if you desire. Eventually I hope to see OVS support built into libvirt but this will help until then.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2618069852664801272-477422089068476157?l=binarybitme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarybitme.blogspot.com/feeds/477422089068476157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarybitme.blogspot.com/2011/09/using-open-vswitch-with-libvirt-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2618069852664801272/posts/default/477422089068476157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2618069852664801272/posts/default/477422089068476157'/><link rel='alternate' type='text/html' href='http://binarybitme.blogspot.com/2011/09/using-open-vswitch-with-libvirt-and.html' title='Using Open vSwitch with libvirt and QEMU/KVM'/><author><name>binarybitme</name><uri>http://www.blogger.com/profile/04938295842357082522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-RwZQgPmZGEg/TnknNGqx9JI/AAAAAAAAAAM/3rwd685HTVY/s72-c/bridge-interface-virt-manager.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2618069852664801272.post-777244757132708014</id><published>2011-07-16T17:16:00.001-05:00</published><updated>2011-07-16T17:56:14.617-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='virtualization'/><title type='text'>pfSense in a Virtualized Environment</title><content type='html'>Just a quick note on &lt;a href="http://pfsense.org/"&gt;pfSense&lt;/a&gt; in a virtualized environment. For whatever reason pfSense hangs during installation in a VM with default VM settings on all hypervisors I have tried. I have seen this on 1.2.3 and 2.0-RC1 on VirtualBox, KVM, and Xen. I have not tested with pfSense 2.0-RC3. The way I found to get around this is to put the cdrom and the harddisk on&amp;nbsp;separate&amp;nbsp;virtual disk controllers. For example sticking one on a SCSI and the other IDE seems to work around the issue. I have tested this in both VBox and KVM.&lt;br /&gt;&lt;br /&gt;If you haven't checked out pfSense it complimants Open VSwitch quite well in a virtualized lab environment as a LAN router and firewall. My favorite firewall/router distribution I have used hands down.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2618069852664801272-777244757132708014?l=binarybitme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarybitme.blogspot.com/feeds/777244757132708014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarybitme.blogspot.com/2011/07/pfsense-in-virtualized-environment.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2618069852664801272/posts/default/777244757132708014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2618069852664801272/posts/default/777244757132708014'/><link rel='alternate' type='text/html' href='http://binarybitme.blogspot.com/2011/07/pfsense-in-virtualized-environment.html' title='pfSense in a Virtualized Environment'/><author><name>binarybitme</name><uri>http://www.blogger.com/profile/04938295842357082522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2618069852664801272.post-4688585640734985099</id><published>2011-07-16T16:46:00.001-05:00</published><updated>2011-07-16T17:54:09.279-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='virtualization'/><title type='text'>VirtualBox 4 Networking Notes</title><content type='html'>I recently setup a lab environment on older hardware that didn't have VT-x. For this setup I used &lt;a href="http://www.virtualbox.org/"&gt;VirtualBox 4 headless&lt;/a&gt;, &lt;a href="http://code.google.com/p/phpvirtualbox/"&gt;phpVirtualBox&lt;/a&gt;, and &lt;a href="http://openvswitch.org/"&gt;Open VSwitch&lt;/a&gt;. I have a few notes worth documenting in one place.&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;If you are trunking to a VBox VM use the vnic type of AMD PCNet PCI II (Am79C970A). This is not the default vnic type. I have been able to trunk to Linux and FreeBSD guests including &lt;a href="http://www.pfsense.org/"&gt;pfSense&lt;/a&gt; using the PCNet II vnic with a trunk from Open VSwitch with no issues. Every other vnic type I tried didn't work for me. I haven't tried the virtio drivers on VBox they may work as well. I do know the virtio drivers work when trunking to a Linux VM on &lt;a href="http://www.linux-kvm.org/"&gt;KVM&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;If you are setting the destination of a mirror in Open VSwitch to a VM vnic on VBox you will need to set extra data on the vnic to allow promisc mode to be enabled.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; VBoxManage setextradata VM_NAME \&lt;br /&gt;"VBoxInternal/Devices/pcnet/0/LUN#0/Config/IfPolicyPromisc" "allow-all"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Replace pcnet with the appropriate vnic type you are using.&lt;/li&gt;&lt;li&gt;VBox comes with VBoxTunctl so you don't need to install tunctl seperatly to create tap interfaces for use with Open VSwitch.&lt;/li&gt;&lt;/ol&gt;A lot of people don't think of VBox except for desktop use but it works very well in a headless server environment. Especially when combined with phpVirtualBox for quick and easy managment and VM console access.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As a side note you don't get 64 bit guests or hardware breakpoints while debugging in a guest without VT-x on VirtualBox :-( but at least you get full virtualization with good performance :-).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Not entirely related but I would love to see enhanced protection such as sVirt like functionally developed for libvirt/KVM on a system with SELinux or Apparmor&amp;nbsp;available. That would go a long why to help protect the host and other guests if an escape from a guest was achieved.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2618069852664801272-4688585640734985099?l=binarybitme.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://binarybitme.blogspot.com/feeds/4688585640734985099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://binarybitme.blogspot.com/2011/07/virtualbox-4-networking-notes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2618069852664801272/posts/default/4688585640734985099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2618069852664801272/posts/default/4688585640734985099'/><link rel='alternate' type='text/html' href='http://binarybitme.blogspot.com/2011/07/virtualbox-4-networking-notes.html' title='VirtualBox 4 Networking Notes'/><author><name>binarybitme</name><uri>http://www.blogger.com/profile/04938295842357082522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
