热门关键字:  ubuntu  分区  函数  Fedora  linux系统进程

当前位置 :| 主页>Linux发行版>Gentoo>

新手安装Xentoo(Xen+Gentoo)的极速体验

来源: 作者: 时间:2008-06-26 Tag: 点击:


2.7、启动Xentoo
#xend start
#xm create /etc/xen/auto/xentoo -c

如无意外即可进入Xentoo登录界面

上述所有操作相当于Gentoo的安装进行了以下步骤
# chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile

2.8、在Xentoo中安装必备软件
#emerge --sync (这里我用了1h)
#emerge fvwm (fvwm最小最快,3h)

fvwm最快的配置方法:
#cp /usr/share/fvwm/system.fvwm2rc-sample-95 ~/.fvwm/.fvwm2rc

安装与配置Gentoo不属于本文讨论范围,请根据Gentoo的手册和自己的需要进行后续安装
安装完后清理垃圾文件(rm -rf /usr/portage/distfiles/*;rm -rf /var/tmp/*)

2.9、配置Xwindow
Xentoo下不能用startx,所以不要着急配置XF86Config,有几种方法进入X:

* forward X11 apps through ssh (connect to the domain with ssh -X, run an
xterm - it should just appear).
* Run "vncserver" in the guest, connect to it from dom0 (or any other system).
By playing with your gdm / kdm / xdm config, you can cause the vncserver to
be started automatically and display the login screen.
* Run Xnest in dom0, tell apps to connect to that instead of a local Xserver.
* Run FreeNX server in the domU, connect to it using the free (as in beer)
client from NoMachine. NX performs well and can do nifty things like
forwarding sound, printing and local filesystems (if you can figure out how
to set it up!)

在这里,以VNC为例,参考HOWTO Xvnc terminal server进行配置,借助VNC就能很轻松进入图形界面 :-)

按照文档配置完,如果直接执行/etc/init.d/xdm restart,还是会出错,/var/log/xdm.log:
xf86OpenConsole: Cannot open /dev/tty0 (No such file or directory)
为什么呢?噢,原来我没有装kdm和gdm,所以只能用xdm了:

修改/etc/X11/xdm/Xservers:
:0 local /usr/bin/X
改为
:0 local /usr/bin/Xvnc -geometry 800x600 -depth 16

修改~/.xsession:
添加
#!/bin/bash
exec /usr/bin/fvwm

重新启动xdm:
#/etc/init.d/xinetd restart
#/etc/init.d/xdm restart

回到domain0,运行vncviewer,连接到domU即可

2.10、在Xentoo中编译新内核要注意的事项

编译过程请参考 HOWTO Xen and Gentoo

编译完成后,poweroff,回到在dom0中,把新内核复制出来,替换旧内核
#mount -o loop xentoo-root.image /mnt/gentoo
#cp /mnt/gentoo/usr/src/linux-2.6.x.y-xen/vmlinuz /boot/vmlinuz-2.6.x.y-xenU
#umount /mnt/gentoo

修改/etc/xen/auto/xentoo:
kernel = "/boot/vmlinuz-2.6.x.y-xenU"

再次启动Xentoo即可
#xm create /etc/xen/auto/xentoo -c

安装到这里基本上大功告成,可以开始享受极速虚拟的Xentoo了……
需要说明一下,标题所说的极速在安装Gentoo的时候是体验不到的,由于Gentoo是基于源码的发行版,所以安装Gentoo是个培养耐心的的过程.我用emerge -p gnome看了一下,需要安装差不多200个包,超过500M的源代码,天哪,如果用我的PII400/128M/6.4G编译的话,可能要花5、6天时间,所以我才安装最小的fvwm.论运行速度Gentoo倒是比其他发行版快不少,花点时间安装还是值得的.欢迎交流宝贵意见,作者的伊妹儿: lostfalcon@tom.com,转载请注明出处.


第三阶段 使Gentoo可以单独启动(脱离Xen)

编译新内核(emerge gentoo-source),根据自己实际情况进行配置和编译

对于直接安装到硬盘分区,修改grub即可

对于安装到image文件,请搜索相关文档



附录:
1、全面介绍Xen虚拟机 (http://tech.ccidnet.com/art/289/20050905/325111_1.html)
2、Xen Users' Manual (http://www.cl.cam.ac.uk/Research/SRG/netos/xen/readmes/user/)
3、Gentoo linux 简介 (http://www.huihoo.com/gentoo/)
4、Gentoo Linux x86 手册 (http://www.gentoo.org/doc/zh_tw/handbook/handbook-x86.xml?full=1)
5、HOWTO Xen and Gentoo (http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo)
6、Gentoo Linux 硬盘安装参考指南 (http://www.linuxfans.org/nuke/modules.php?name=Forums&file=viewtopic&t=5921)
7、How to run Xwindows in the guest OS (http://lists.xensource.com/archives/html/xen-users/2005-09/msg00630.html)
8、HOWTO Xvnc terminal server (http://gentoo-wiki.com/HOWTO_Xvnc_terminal_server)

最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册
栏目列表
热点关注
相关文章