国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Linux > 正文

debian下qemu配置詳解

2024-08-28 00:21:53
字體:
供稿:網(wǎng)友
1、kqemu模塊的加載

在/etc/modules上增加kqemu,讓系統(tǒng)啟動時(shí)自動加載kqemu模塊。

然后udev會自動生成一個(gè)叫做kqemu的設(shè)備:
xuwei@XIAO:~$ ls -l /dev | grep kqemu
crw-rw-rw- 1 root root 10, 63 2006-12-19 09:28 kqemu

2、配置qemu使用tap/tun模式

tap/tun模式需要內(nèi)核支持tun模塊,請先確認(rèn)。

2.6.18 及以上版本內(nèi)核,由于修改了對tun模塊的執(zhí)行權(quán)限,需要增加一個(gè)腳本。詳細(xì)請參閱http://kidsquid.com/cgi- bin/moin.cgi/FrequentlyAskedQuestions#head-989268518a820a9f33477d3b99754ab5113aa2a3。在此也把該faq貼過來。

I'm using a kernel >=2.6.18 and am having problems with tun/tap and qemu
Starting with 2.6.18 a user process must be root to manage tap interfaces. One way to make qemu behave as before is to wrap the process in a that manages the interface:

qemu-tap

#!/bin/sh# to manage tap interface allocation# for linux kernels >= 2.6.18# set up a tap interface for qemu# USERID - uid qemu is being run under.USERID=`whoami`iface=`sudo tunctl -b -u $USERID`# generate a random mac address for the qemu nic# shell borrowed from user pheldens @ qemu forumranmac=$(echo -n DE:AD:BE:EF ; for i in `seq 1 2` ; /do echo -n `echo ":$RANDOM$RANDOM" | cut -n -c -3` ;done)# specify which NIC to use - see qemu.org for othersmodel=ne2k_pci# model=ne2k_isa# start qemu with our parametersqemu $@ -net nic,vlan=0,macaddr=$ranmac,model=$model / -net tap,vlan=0,ifname=$iface# qemu has stopped - no longer using tap interfacesudo tunctl -d $iface &> /dev/null
You would then start qemu using this wrapper: ./qemu-tap -hda deb-sid.img -localtime

You need tunctl, a program from the usermode linux project, to make this work. On debian the package is called uml-utilities.

Please feel free to modify the .

然后,設(shè)置/etc/qemu-ifup
xuwei@XIAO:~$ cat /etc/qemu-ifup
#!/bin/sh
sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1
并且,把該腳本設(shè)置成可執(zhí)行權(quán)限:
xuwei@XIAO:~$ ls -l /etc | grep qemu
-rwxr-xr-x 1 root root 66 2006-12-17 11:17 qemu-ifup

這就搞定了。直接qemu-tap .img就可開啟虛擬機(jī),并且使用tap/tun模式。開啟虛擬機(jī)以后,ifconfig可以看到生成了一個(gè)tap0接口。host和guest正是通過該tap0接口通信的。
發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 怀化市| 绍兴县| 华容县| 融水| 本溪市| 阿尔山市| 涿鹿县| 平邑县| 万荣县| 舞钢市| 丰顺县| 张掖市| 芒康县| 陇西县| 大方县| 景德镇市| 福建省| 凤台县| 隆尧县| 太白县| 江源县| 苏尼特左旗| 茂名市| 华宁县| 广东省| 泽普县| 巴林右旗| 乐业县| 紫金县| 惠安县| 恩平市| 安徽省| 萝北县| 延安市| 新津县| 建瓯市| 岑溪市| 茌平县| 岑溪市| 蕉岭县| 安仁县|