|
|
如题,
觉以前的硬盘分区不合理,重新分区了一下,也就重新装了一次系统,却配置不起来qemu了。请各位大虾帮忙看一下。
症状是,- $ ./qemu-old
- warning: could not configure /dev/net/tun: no virtual network emulation
- Could not initialize device 'tap'
复制代码- $ ls -l /dev/net/tun
- crw-rw-rw- 1 root root 10, 200 2007-05-21 13:11 /dev/net/tun
复制代码
网络配置文件,- $ 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
- #w allow-hotplug eth0
- #w iface eth0 inet dhcp
- # Bridge for QEMU
- auto br0
- iface br0 inet dhcp
- bridge_ports eth0
复制代码
网络设备,- $ /sbin/ifconfig
- br0 Link encap:Ethernet HWaddr 00:50:8D:60:6A:3A
- inet addr:192.168.1.142 Bcast:192.168.1.255 Mask:255.255.255.0
- inet6 addr: fe80::250:8dff:fe60:6a3a/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:14679873 errors:0 dropped:0 overruns:0 frame:0
- TX packets:10392322 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:255631619 (243.7 MiB) TX bytes:2153579640 (2.0 GiB)
- eth0 Link encap:Ethernet HWaddr 00:50:8D:60:6A:3A
- inet6 addr: fe80::250:8dff:fe60:6a3a/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:15034959 errors:0 dropped:0 overruns:0 frame:0
- TX packets:10392328 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:485294836 (462.8 MiB) TX bytes:2157563908 (2.0 GiB)
- Interrupt:11 Base address:0xc000
- 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:16436 Metric:1
- RX packets:543799 errors:0 dropped:0 overruns:0 frame:0
- TX packets:543799 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:101077542 (96.3 MiB) TX bytes:101077542 (96.3 MiB)
复制代码
qemu调用文件,- $ cat qemu-old
- #!/bin/sh
- nice -n 5 qemu -localtime -boot c -no-fd-bootchk -kernel-kqemu -hda /media/data/qemu/win2k.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=~/qemu-ifup-old
复制代码- $ cat qemu-ifup-old
- #!/bin/sh
- # sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1
- # $1 is the ethernet(usually tapX)
- MYBR="br0"
- echo "Executing /etc/qemu-ifup"
- # sudo /usr/sbin/brctl addbr $MYBR
- echo "Bringing up $1 for bridged mode..."
- sudo /sbin/ifconfig $1 up
- echo "Adding $1 to $MYBR..."
- sudo /usr/sbin/brctl addif $MYBR $1
- sleep 1
复制代码
公司的打印机只支持windows,就靠这个虚拟机了。没设置起来,很麻烦,不得不求助各位。 |
|