Hi! Dear everyone. I met a problem with virsh. What should I do if I hope to start my guest os with specified IP address and guest os can be accessed by external computers? I tried to use route mode to configure my virbr0, but it cannot assign an IP to my guest os! If virbr0 are set NAT mode and act as a switch with dhcp, then the guest os cannot be accessed by external computer. note: Ubuntu server are install in host without xwindows, so I have to work with command line. Thanks!
Cyrill von Wattenwyl
2015-Dec-15 10:03 UTC
Re: [libvirt-users] How to start guset os with specified IP address
Hello Am 08.12.2015 um 16:49 schrieb 落痕:> What should I do if I hope to start my guest os with specified > IP address and guest os can be accessed by external computers? > I tried to use route mode to configure my virbr0, but it cannot > assign an IP to my guest os! > If virbr0 are set NAT mode and act as a switch with dhcp, then the > guest os cannot be accessed by external computer.You need to do this on network-level, i dont think that's possible with libvirt only. One solution would be to specify an custom mac-address in the xml-file, which your dhcp resolves to a fixed ip. It should be possibe to script this. Another way would be to use plain preseed and run a script inside which tells an server (http with an simple script) which ip adress your new vm has. Then you could query this server for the ip. But there are allready tools for such user cases, i would suggest you to look into foreman [1], this may solves your problem more elegant than a custom solution. Best Regards, Cyrill [1] http://theforeman.org/ -- Adfinis SyGroup AG Cyrill von Wattenwyl, System Engineer Keltenstrasse 98 | CH-3018 Bern Tel. +41 31 550 31 11 | Direkt +41 31 550 31 17