Host-only-like interface in KVM

You can create another bridge interface, the same as you did for the one to connect to your main network, but don't attach any outside interfaces to it. Then assign your computer an IP on the bridge and the VMs and the host should be able to talk to it. i.e. exactly what the VirtualBox host-only adapter does.


Expanding on Justin's idea

I'm no genius, but this worked for me and you somewhat need to know what you are doing. host:Ubuntu 12.04. guest: Debian Testing (Jessie)

For Debian based systems configure the network interface by adding or editing the following in the host /etc/network/interfaces file (ifconfig -a is your friend):

auto br0
iface br0 inet static
        address 192.168.12.100
        netmask 255.255.255.0
        network 192.168.12.0
        broadcast 192.168.12.255
        bridge_ports none
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0

Restart networking on the host machine or just restart the computer. Then using virt-manager added the unbridged network device br0 to the network interface of the guest.

Then on the guest system you will have to assign a static IP address since there is no DHCP running on the br0 device. Setting a static IP address will depend on the OS.

For a Debian based guest you would edit /etc/network/interfaces and add:

auto eth0
iface eth0 inet static
            address 192.168.12.101
            netmask 255.255.255.0
            broadcast 192.168.12.255

I very much needed this setup and spent a couple of nights trying to find this through trial and error. You might need to change the numbers on the devices (br1 instead of br0, or eth1 instead of eth0). If your guest needs Internet access, then more setup will be needed.


To easily create virtual networks, you can install "virt-manager" by using the following command in Terminal

sudo apt-get install virt-manager

Once you install virt-manager, you can bring up the gui by running it from the command prompt or using the super key to bring up the search and searching for "virt-manager"

To create an interface, select localhost, and right-click and select "Details". From there, click on the "VIrtual Networks" tab and create a new interface. Everything is self-explanatory from there. Insure you select isolated network to keep the vm from using an external network.