|
|
[color="Red"]特别提醒:操作需要 root 权限,敬请小心谨慎!
运行环境:sid amd64 vbox-1.4
一、桥接
- 首先安装必要软件:
- ~# apt-get install uml-utilities bridge-utils
复制代码
- 然后修改 /etc/network/interfaces(修改之前做好备份):
- auto lo eth0 tap0 br0
- iface lo inet loopback
- iface br0 inet dhcp
- bridge_ports eth0 tap0
- bridge_maxwait 0
- bridge_fd 0
- iface eth0 inet manual
- iface tap0 inet manual
- pre-up tunctl -u [i]<your_user>[/i] -t tap0
- pre-up ifconfig tap0 up
- post-down tunctl -d tap0
复制代码
<your_user> 用你的用户名代替
如果网络地址是静态的,修改 br0 的设置为:
- iface br0 inet static
- address xxx.xxx.xxx.xxx
- network xxx.xxx.xxx.xxx
- .
- .
- .
- bridge_ports eth0 tap0
- bridge_maxwait 0
复制代码
- 设置完毕后执行:
- 在 VirtualBox 的网络设置里选择 “连接到 Host Interface",”主机网络界面名称“填 tap0,”设置程序“和“中断程序”都留空,支持桥接网络配置完成,这样启动的虚拟机就跟主机是同一个网段的了。
二、USB 设备
- 首先添加 usbfs 组
- 在 /etc/fstab 里面添加一行
- ~# echo "procbususb /proc/bus/usb usbfs devmode=0664,devgid=`cat /etc/group | grep usbfs | cut -d : -f 3` 0 0" >> /etc/fstab
复制代码
- 把用户加入 usbfs 组
- ~# adduser [i]YOUR_USER[/i] usbfs
复制代码
- 重新挂载 /proc/bus/usb
- ~# mount -o remount /proc/bus/usb
复制代码
- 注销并重新登录,在 VirtualBox 的 USB 设置里选择 “启用USB控制器”,然后在下面添加一个“各个域的值都为空的筛选器”,就是右边最上面那个按钮(Add Empty (Ins)),这样就能直接使用连接到主机上的 USB 设备了。
------------
参考文章:
[color="Blue"]http://andete.blogspot.com/2007/04/debian-in-kvm-mini-howto.html |
|