来自http://tunps.com/virtualbox-on-linux-to-emulate-windows-xp
本来在Linux现面使用wine感觉还是挺好的,但是发现有很多的程序都运行得不是十分的完美。
要莫点不起按钮,要莫没有显示,还真的成了难题了,
我倒是觉得用wine还运行一些小程序倒是可以的,比如exe格式的电子书之类的。
这个世界有很多优秀的虚拟机:vmare workstation /qemu /bochs /virtualbox
vmware是商业软件,太贵了,买不起。
觉得VirtulBox还是挺适合我们这总菜鸟的,GUI的版本,操作简单嘛。
VirtualBox介绍
首先还是要简单的了解一下VirtualBox
登录项目网站:http://www.virtualbox.org

innotek VirtualBox is a family of powerful x86 virtualization products for enterprise
as well as home use. Not only is VirtualBox an extremely feature rich, high performance
product for enterprise customers, it is also the only professional solution that is freely
available as Open Source Software under the terms of the GNU General Public License (GPL). See "About VirtualBox"
for an introduction; see "innotek" for more about our company.
Presently, VirtualBox runs on Windows, Linux and Macintosh hosts and supports a large number of guest operating systems
including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista), DOS/Windows 3.x, Linux (2.4 and 2.6),
and OpenBSD.
VirtualBox is being actively developed with frequent releases and has an ever growing list of features,
supported guest operating systems and platforms it runs on. VirtualBox is a community effort backed by
a dedicated company: everyone is encouraged to contribute while innotek ensures the product always meets
professional quality criteria.
On this site, you can find sources, binaries, documentation and other resources for VirtualBox.
If you are interested in VirtualBox (both as a user, or possibly as a contributor), this website is for you.
以上我们可以看出来VirtualBox是一个叫innotek的公司以GPL协议发布的开源软件。
并且支持现在的大多数的平台,linux / windows /mac os /freebsd /.。。
如果你和我一样是一个菜鸟,那麽你一定要下载用户手册仔细的看看了
下载地址是:http://www.virtualbox.org/download/UserManual.pdf
事实上VirtualBox分为两个版本,一非源码的版本,这个包括了所有的特性
还有一个VirtualBox Open Source Edition (OSE) ,这个版本是源码版本,但是少了一下这些特性:
* Remote Display Protocol (RDP) Server
* USB support
* USB over RDP
* iSCSI initiator
下载VirtualBox
下载的时候要注意的地方是:下载的包要符合你计算机的cpu构架,如果在64兼容cpu上面运行的是32位的内核,
那麽你需要安装x86/i386版本。这里所有的AMD64和x86_64是同一个版本。
我是386构架的,下载了一个和发行版无关的通用版本,下载url:http://www.virtualbox.org/download/1.5.2/VirtualBox_1.5.2_Linux_x86.run
源码包下载http://www.virtualbox.org/download/1.5.2/VirtualBox-1.5.2_OSE.tar.bz2
安装VirtualBox
suse:/dat/soft # sh VirtualBox_1.5.2_Linux_x86.run
这样就安装好了,所有这个程序的目录在/opt/VirtualBox-1.5.2/目录下.
suse:/opt/VirtualBox-1.5.2 # VirtualBox & 这样就启动了。 设置VirtualBox
启动的时候:

点菜单栏file—>preference–>language—>simplified chinese改成我们熟悉的中文界面。
点工具栏-->新建–>下一步—>名字就叫XP好了—>系统类型:windows Xp.—>内存默认:192MB
–>新建–>下一步–>动态扩展映像。–>镜像名字:xp 大小 我给个3GB.就够了–>最后完成
有两种方法安装windows xp..
要莫直接的插入你的XP系统盘,然后工具栏–>设置–>光驱。点上主机上的光盘,然后就安装,具体安装XP都会了吧,
我的方法:cp /dev/cdrom /root/winxp.iso把XP的系统盘复制成一个iso镜像,这个不磨损我可爱的刻录机:)
suse:/dat # file winxp.iso
winxp.iso: ISO 9660 CD-ROM filesystem data 'TOMTOWINXP_SP2_V3.2 ' (bootable)


默认的情况下guest os (就是XP),没有网卡,声卡,显示卡的驱动,
启动winxp ,点"设备"-->安装虚拟电脑工具包。然后在xp下面点开光盘的盘符,就开始自动安装virtualboxadditons了
然后重新启动就可以使用设备了,哦,忘了说了vbox有个host的键,你可以通过自己的设置来进行快捷的操作,常用的就是在
guest os 和host os的鼠标的切换,vbox下面可以实现无缝的复制粘贴,可以说是具方便啊
然后接下来的故事是这样的,我安装的XP安装盘,因为安装了一个M$一个防盗版的补丁,非要我通过wga认证,很恼火阿。
网上下载了一个wgapatch.rar的补丁来破解,但是我不知道怎么把文件从opensuse复制到win xp。。。
最后还是被我找到了方法。。vbox不需要通过网络设置。文件共享是通过vbox在host主机上的一个特殊服务和vboxadditons
上面的文件系统的驱动来实现的。目前支持的guest os有Windows XP, Windows 2000 and Linux 2.4 and 2.6 guests.
方法很简单:
首先在vbox上面设置–>共享文件夹–>添加目录"/"名字随便你,这里我取名为:all
进入xp 的cmd….然后输入net use g: \\vboxsvr\all
解释一下g:是你要映射的盘符,vboxsvr是hostos固定的名字,不可以改变的,all是共享名
效果如图:


网络方面
同时我也方面,我用的是学校的dr.com登录上网的,默认的情况下使用NAT网络连接是可以连接到外网的,如果有不同的网络情况,
还是请大家自己实验,没有这样多的经历来研究不同的网络环境。