qemu network same ip
hy
i run qemu like this but for every machine he give same ip. xml file of virbr0 have dhcp range. when i run with virsh i dont have this problem just when run like this Code:
qemu-system-x86_64 -vga std -nographic -vnc :2 -m 1G -smp 4 -enable-kvm -drive format=raw,file=/home/ja/vm/kali.img -usbdevice tablet -net bridge,br=virbr0 -net nic,model=virtio & |
Kako si bio moj prijatelj? :)
Do you have dnsmasq installed to act as your dhcp front-end? You know I do love a good manual... Virsh is chatting up libvirt, which has an internal dhcp capability. |
re
good my frend good expect this kind of problems. how are you? where are you from by the way i need put you in some place on earth :)
i have problem with this dnsmasq i set it up and bind to virbr0, remove default.xml that virsh use. and when i start virsh net-start default he pull same config like xml is still there. is there another way to start virbr0 interface. actualy dont bother with this. new approach if i create vlan like this https://wiki.archlinux.org/index.php/VLAN how to use that interface in qemu command |
hy
in libvirt network default.xml i remove dhcp options, in dns masq.conf set interface to virbr0 and add dhcp-range. when run vm they dont get ip no problem i ad it manually have internet acces just these two machine canot ping or comunicate in any way. |
what i try
kill all dnsmasq process, then Code:
dnsmasq --interface=virbr0 --bind-interfaces --dhcp-range=192.168.122.2,192.168.122.10 Code:
qemu-system-x86_64 -vga std -display none -vnc :1 -m 2G -smp 2 -enable-kvm -drive format=raw,file=/home/ja/vm/w7.img -usbdevice tablet -net bridge,br=virbr0 -net nic,model=virtio then i try Code:
qemu-system-x86_64 -vga std -nographic -vnc :2 -m 1G -smp 4 -enable-kvm then i try user mode Code:
qemu-system-x86_64 -vga std -nographic -vnc :2 -m 1G -smp 4 note: when i use virsh to start vm's no problem in communication in any way. but virsh slow down my comp with 2 vm's i cannot nothing. Prichiated edited: now i created tap and tap1 interfacewith same subnet 192.168.1.1/24 in dnsmasq.conf i added interface=tap interface=tap1 dhcprange=iprange dhcprange=iprange again dnsmasq gives same ip to boath vm's. so defenetly problem with dnsmasq. edited: i can do thing like this tap=192.168.1.1 tap1=192.168.2.1 dnsmasq interface=tap interface=tap1 dhcprange=192.168.1.2,192.168.1.10,12h dhcprange=192.168.2.2,192.168.2.10,12h Code:
iptables -I INPUT -i tap -j ACCEPT Code:
sudo qemu-system-x86_64 -vga std -nographic -vnc :2 -m 1G -smp 4 So if anyone know way dnsmasq giving same ip to two different machines i will prichiated. even i like most last solution, its complicating life beacouse i only test python scripts beatwen vm's. And maybe in future i will need dnsmasq to work proper. thanks |
All times are GMT -5. The time now is 03:55 AM. |