Ubuntu系统下安装Virtualbox虚拟XP过程

时间:2008-03-04 11:15:12   来源:赛迪网  作者:sixth  点击:次  出处:技术无忧
关键字:linux ubuntu xp 虚拟机

你有email邮箱吗?经常收到垃圾邮件而烦吗?立即使用邮箱LOGO在线制作酷Email logo图片

1.安装virtual box

可以使用新立德搜索virtual box安装,也可以使用命令行apt-get 安装.

2.添加用户到vboxusers 用户组(一般是ubuntu登陆的用户)

系统--用户管理--用户和组把用户添加到vboxusers 用户组,也可以使用sudo adduser youruser vboxusers 添加.

3.安装xp系统

从新启动系统(主),打开virtual box安装操作系统

4.虚拟机桥接的实现

首先安装两个软件:sudo apt-get install uml-utilities bridge-utils(建立虚拟网络设备 ( TAP interfaces ) 的工具 uml-utilities 和桥接工具 bridge-utils)

为了使你的虚拟机能够访问网络接口,你必须将运行虚拟主机的用户的用户名(通常是你的ubuntu登录用户名)添加到uml-net用户组(请用你的用户名替换其中的“vboxuser”):


sudo gpasswd -a vboxuser uml-net

5.操作系统描述你要添加的虚拟网络设备,编辑 /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
allow-hotplug eth0
iface eth0 inet manual
up ifconfig eth0 0.0.0.0 promisc up
auto eth0

auto tap0
iface tap0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
tunctl_user well(这个改成你的用户名)

auto br0
iface br0 inet static
address 你的ip
netmask 255.255.255.0
network 你的ip,最后一组改为0
broadcast 你的ip,最后一组改为255
gateway 你的网关的ip
(如果你用的dhcp,上面6行请改为 iface br0 inet dhcp )
bridge_ports all tap0
 


6.激活刚才建立的虚拟网络接口和网络桥:


sudo /sbin/ifup tap0


sudo /sbin/ifup br0


这个步骤只需要做一次,下次主机重新启动时,这个接口和桥将自动激活

7.让 virtualbox 使用这个虚拟网络接口。

启动 virtualbox,在主界面上选中要使用刚才建立的虚拟网络接口tap0的虚拟机,点“设置”,在弹出的窗口中选“网络”,选中其中一块网卡(通常为 “网络适配器 0”),选中“启用网络适配器”,“连接到”后面选 "Host Interface",选中“接入网线”,然后在“主机网络界面名称”中填入刚才建立的虚拟网络接口的名字 "tap0",确定。

8.配置虚拟机网卡地址。其实很简单,和主机的br0一样的配置,只是ip改一个不重复的即可。子网掩码、网关、DNS 都不变,与br0的设置一样。

到此虚拟机以可以上网了.

收藏:http://www.pc51.net/system/unix/linux/2008-03-04/o10210.html

文章评论

共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面