aviso de novato: sou completamente novo em virtualização, por isso pode haver uma solução ridiculamente simples para isso ...
Estou tentando executar uma máquina virtual com o KVM no Ubuntu 14.04.1 LTS como host.
Para facilitar o uso, eu construo o vm com o vmbuilder.
Eu quero host e convidado para obter cada um seu endereço IP de um servidor DHCP separado já existente.
- > Eu acredito que eu preciso de uma ponte de rede para isso.
Consegui configurar e executar uma VM com o NAT, mas passar para a rede de ponte me colocou emperrado.
Eu posso construir a VM e ativá-la, mas não vejo uma entrada ARP ou qualquer tráfego do endereço MAC do convidado, por isso não tenho idéia de qual IP é atribuído.
Isso me deixa com a seguinte pergunta, para a qual respostas ou sugestões seriam muito apreciadas:
- Eu estraguei algo na configuração de rede?
- Como decifro qual endereço IP meu convidado recebeu?
Muito obrigado!
Como eu construo a VM:
kidmose@radagast:~$ sudo vmbuilder kvm ubuntu -o \
--hostname vm-bridged \
--libvirt qemu:///system \
--addpkg openssh-server \
--destdir=./virtual-machines \
--flavour virtual \
--bridge br0 \
--suite precise
kidmose @ radagast: ~ $ cat / etc / network / interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# # The primary network interface
# auto em1
# iface em1 inet dhcp
# Bridged network interface
auto br0
iface br0 inet dhcp
bridge_ports em1
bridge_stp off
kidmose @ radagast: ~ $ brctl show
bridge name bridge id STP enabled interfaces
br0 8000.c81f66cce0eb no em1
vnet0
virbr0 8000.000000000000 yes
kidmose @ radagast: ~ $ ifconfig
br0 Link encap:Ethernet HWaddr c8:1f:66:cc:e0:eb
inet addr:10.20.12.216 Bcast:10.20.12.255 Mask:255.255.255.0
inet6 addr: fe80::ca1f:66ff:fecc:e0eb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3239 errors:0 dropped:0 overruns:0 frame:0
TX packets:430 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:493254 (493.2 KB) TX bytes:54832 (54.8 KB)
em1 Link encap:Ethernet HWaddr c8:1f:66:cc:e0:eb
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3269 errors:0 dropped:0 overruns:0 frame:0
TX packets:449 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2648215 (2.6 MB) TX bytes:58759 (58.7 KB)
Interrupt:16
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
virbr0 Link encap:Ethernet HWaddr 62:dc:74:f4:4d:69
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
vnet0 Link encap:Ethernet HWaddr fe:54:00:ce:0a:3c
inet6 addr: fe80::fc54:ff:fece:a3c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:261 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:2143 (2.1 KB) TX bytes:50735 (50.7 KB)
kidmose @ radagast: ~ $ virsh dumpxml vm-bridged
<domain type='kvm'>
<name>vm-bridged</name>
<uuid>3d2fa61d-81ed-420b-afd3-00584b5ac116</uuid>
<memory unit='KiB'>131072</memory>
<currentMemory unit='KiB'>131072</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/home/kidmose/virtual-machines/tmpAQAZpr.qcow2'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='bridge'>
<mac address='52:54:00:ce:0a:3c'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</memballoon>
</devices>
</domain>