초보자 경고 : 가상화에 완전히 익숙하지 않으므로 이것에 대한 어리석게 간단한 해결책이있을 수 있습니다 ...
Ubuntu 14.04.1 LTS에서 KVM을 호스트로 사용하여 가상 머신을 실행하려고합니다.
사용하기 쉽도록 vmbuilder로 vm을 빌드합니다.
호스트와 게스트가 이미 존재하는 별도의 DHCP 서버에서 각 IP 주소를 가져 오기를 원합니다.
-> 네트워크 브리지가 필요하다고 생각합니다.
NAT를 사용하여 VM을 설정하고 실행할 수 있었지만 브리지 된 네트워킹으로 넘어 가면서 문제가 발생했습니다. VM을 빌드하고 스핀 할 수는 있지만 게스트 MAC 주소에서 ARP 항목이나 트래픽이 표시되지 않으므로 할당 된 IP가 무엇인지 알 수 없습니다.
이것은 나에게 다음과 같은 질문을 남겼습니다.
- 네트워크 설정에서 무언가를 습득 했습니까?
- 내 게스트가 어떤 IP 주소를 할당했는지 어떻게 알 수 있습니까?
대단히 감사합니다!
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 : ~ $ 고양이 / 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 쇼
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>