
첫 번째 VM을 설정하고 브리징을 사용하여 네트워크에 액세스하고 있습니다. Ubuntu 14.10의 Windows7 VM입니다. VM 정의에서 'Device Model = VirtIO'로 변경하면 이더넷 성능이 향상된다는 내용을 읽었습니다. rtl8139에서 VirtIO로 변경하면 VM의 이더넷 연결이 끊어집니다. 어떤 제안이 있으십니까?
참고 사항: 이 질문에서 알 수 있듯이 저는 Linux 세계에 처음 입문했습니다. 실제로는 VM을 무선 어댑터(비활성화함)에 브리지하는 것을 선호하지만, 제가 읽은 내용 중 상당수는 무선 어댑터를 통해 브리지할 수 없다고 말합니다.
어떤 조언을 해주셔서 감사합니다.
내 win7 VM은 KVM과 함께 제공되는 GUI 도구를 사용하여 생성/정의되었습니다. 아이콘 위로 마우스를 가져가면 'Virtual Machine Manager'라고 표시됩니다. 이미 브리지가 설정되어 있습니다. 유선 연결 및 /etc/libvirt/qemu/win7.xml 파일 매개변수의 모델 유형이 rtl8139인 경우에 작동합니다. Virtual Machine Manager 또는 nano 텍스트 편집기를 사용하여 virtIO로 변경하면 Ubuntu 호스트 및 win7 VM에 대한 LAN 연결이 끊어집니다. 다음은 ifconfig의 출력입니다.
br0 Link encap:Ethernet HWaddr 08:62:66:28:84:88
inet addr:192.168.1.75 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: 2602:304:cd91:e710:bd86:dd51:d7dd:bc0a/64 Scope:Global
inet6 addr: fe80::a62:66ff:fe28:8488/64 Scope:Link
inet6 addr: 2602:304:cd91:e710:a62:66ff:fe28:8488/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1094 errors:0 dropped:0 overruns:0 frame:0
TX packets:151 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:79513 (79.5 KB) TX bytes:18098 (18.0 KB)
eth0 Link encap:Ethernet HWaddr 08:62:66:28:84:88
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1483 errors:0 dropped:0 overruns:0 frame:0
TX packets:151 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:248992 (248.9 KB) TX bytes:19177 (19.1 KB)
Interrupt:20 Memory:dff00000-dff20000
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:217 errors:0 dropped:0 overruns:0 frame:0
TX packets:217 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:55759 (55.7 KB) TX bytes:55759 (55.7 KB)
virbr0 Link encap:Ethernet HWaddr 3a:13:59:8b:2e:07
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)
Ubuntu 호스트와 Win7 VM은 모두 DHCP에서 IP 주소를 가져옵니다. 내 '인터페이스' 섹션은 MAC 및 모델 유형을 제외하고 귀하의 섹션과 동일합니다. 지난번 답글에 잘못된 정보를 드렸네요. 나는 win7.xml 파일의 텍스트를 보기 위해 nano만을 사용하고 있습니다. 파일을 편집하는 데 사용하지 않습니다. Virtual Machine Manager GUI를 사용하여 rtl8139와 virtIO 사이의 모델 유형을 변경하고 있습니다. 변경한 후에는 nano를 사용하여 파일을 열고 살펴봄으로써 win7.xml 파일에 새 모델 유형 값이 표시되는지 확인합니다.
죄송합니다. xml 파일을 편집 창에 붙여넣는 데 문제가 있습니다. 그렇게 하면 편집 창에서 전체 파일을 볼 수 있지만 저장된 편집 내용에는 두 줄만 표시됩니다. 아마도 파일을 해석하고 특수 문자를 제거하려고 하는 것 같습니다. 전체 파일을 붙여넣는 방법에 대한 지침을 찾을 수 없습니다. 파일을 첨부하는 방법이 있나요? 그런데 - 이 문제에 대해 도움을 주셔서 다시 한번 감사드립니다.
답변1
Windows 게스트의 경우 virtio가 제대로 작동하려면 특수 드라이버를 설치해야 할 수도 있습니다. 다음 참고 자료를 참조하세요.
http://wiki.libvirt.org/page/Virtio
http://www.linux-kvm.org/page/WindowsGuestDrivers/Download_Drivers
https://launchpad.net/kvm-guest-drivers-windows/+download
다음은 내 VM 중 하나에서 가져온 것입니다. Mac 주소와 주소 줄은 다를 수 있습니다.
<interface type='bridge'>
<mac address='52:54:00:c1:f1:b8'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
그게 당신에게 효과가 없다는 말씀이신가요? 192.168.1.0 서브넷은 IP 주소를 어떻게 얻나요? DHCP를 통해 또는 정적을 통해?
컨텍스트에 따라 전체 .xml 파일은 다음과 같습니다.
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
virsh edit desk_tt
or other application using the libvirt API.
-->
<domain type='kvm'>
<name>desk_tt</name>
<uuid>4235912f-1d46-8866-22ba-c91bfe2a86b7</uuid>
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
<vcpu placement='static'>4</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-1.7'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/kvm-spice</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/media/newhd/desk_tt.img'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<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'/>
<interface type='bridge'>
<mac address='52:54:00:c1:f1:b8'/>
<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='0.0.0.0'>
<listen type='address' address='0.0.0.0'/>
</graphics>
<video>
<model type='vmvga' vram='16384' 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='0x05' function='0x0'/>
</memballoon>
</devices>
</domain>