分类:
2012-05-15 13:05:35
原文地址:Qemu启动网络设置 作者:tezuka158
apt-cache search qemu sudo apt-get install qemu |
./configure && make && make install |
whereis qemu |
sudo ./configure sudo make sudo make install |
ls -l /dev/kqemu |
sudo mknod /dev/kqemu c 250 0 sudo chmod 666 /dev/kqemu |
sudo modprobe kqemu || sudo insmod kqemu.ko lsmod | grep kqemu dmesg | tail |
qemu-img create ubuntu.img -f raw 10G qemu -hda ubuntu.img -cdrom ubuntu-8.04-server-i386.iso -kernel-kqemu -m 512 |
ls -l /lib/modules/2.6.22-14-generic/kernel/drivers/net/tun.ko |
sudo apt-get install uml-utilities sudo modprobe tun sudo mkdir /dev/net sudo mknod /dev/net/tun c 10 200 sudo tunctl |
/sbin/ifconfig $1 192.168.10.1 netmask 255.255.255.0 |
ifconfig eth0 192.168.10.2 up route add default gw 192.168.10.1 |
echo "1" > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o eth0 -s 192.168.10.0/24 -j MASQUERADE |
qemu -serial stdio -net nic,model=rtl8139 -net tap ubuntu.img |