On 04/13/2013 02:42 PM, Evaggelos Balaskas wrote:> Perhaps a stupid question, but i will give it a try:
>
> I have two machines on libvirtd session and network on usermod.
> Can i (somehow) cross these two machines ?
>
> machineA:
> ip addr add 10.10.10.101/24 dev eth0
> ip route add default via 10.10.10.102 dev eth0
>
> machineB:
> ip addr add 10.10.10.102/24 dev eth0
> ip route add default via 10.10.10.101 dev eth0
If you mean your guests are using qemu:///session (i.e. they are
launched from a non-privileged copy of libvirtd), then the only way you
could do that is by setting up port forwarding for every port that you
want to be reachable on each guest. That is not only tedious, but also
unsupported (so you would have to use "qemu commandline passthrough"
to
do it).
If your libvirt and qemu are new enough, you can use bridged networking
even from qemu:///session-initiated guests; as long as there is a system
libvirtd running, and it has the standard default network, which creates
a "virbr0" bridge device, you can configure the guests with
<interface type='bridge'>
<source bridge='virbr0'/>
...
</interface>
If your libvirt and qemu are able, they will run qemu's suid
"qemu-bridge-helper" application which will create a tap device,
connect
it to virbr0, and pass it back to qemu for use by the guest. Once you've
done this, both guests will be on the same network (192.168.122.0/24 by
default) and thus able to directly contact each other. They will still
be behind a NAT though, so unreachable from the outside. Look up
"qemu-bridge-helper" for instructions on the necessary ACL
configuration
for qemu-bridge-helper (each user that will use this type of network
connection needs to be listed in a config file somewhere).