On Sun, 06/21 01:32, Васил Рангелов wrote: > Hi. > > As part of testing an application, I need to set up a network between the > host and the VM so that they can both be accessed from the host on the same > ports via different IPs. This can be done easily with VirtualBox (and I've > already done it...) but I need to do it with Qemu instead, as the tests > should eventually be ran on Travis-CI, which (if a few articles I've seen > are to be believed) can be ran in that environment, while VirtualBox can't. > > How can this be done?
You can use a bridged network setup, so your guest and host have their own IPs. http://www.linux-kvm.org/page/Networking#private_virtual_bridge > > I managed to successfully use > ``` > "-netdev" "user,id=user.0 ,hostfwd=tcp::38728-:8728" "-device" > "virtio-net,netdev=user.0" > ``` > to set up port forwarding from a localhost port to the VM, but the tests > themselves require the same port on both host and VM, so that's not a > feasible solution :-/ . > > I should note that my personal host OS is Windows Server 2008 R2, with IIS > being the server that occupies the ports on the host. On Travis-CI, I'd of > course be using Apache as an equivalent, but the point is the setup should > be as cross platform as possible (if possible at all...), so that the > application can be tested reliably on both hosts. > > Regards, > Vasil Rangelov > >