LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1226|回复: 7

呵呵,刚把xen装上了,还没弄清怎么用,有装了的就进来说说用的感觉吧

[复制链接]
发表于 2005-8-16 15:24:52 | 显示全部楼层 |阅读模式
刚把xen装上,机子启动时选xen,开机时后发现和平常开机没什么两样。进去后才发现以前自动挂载的硬盘没有挂,声音没有了。别的感觉和平常的都差不多,可能也就内核换了xen的,别的都没变吧。还没弄清该怎么用,有什么用,不知道网上说的那种“沙盒”的感觉什么时候才能用上和感觉到。估计前途应该是光明的,道路则将是曲折的。快要考试了,只好慢慢来了。


因为是在debian下装的,就发到这了。装时还是费了些周折的,感觉如果不是在debian下照我今天的情况肯定是装不上了。
过程如下:
1。apt-get install xen,

2.照着这里
http://www.cl.cam.ac.uk/Research ... dmes/user/user.html
的依样改了menu.lst.它原是:

title Xen 2.0 / XenLinux 2.6
  kernel /boot/xen-2.0.gz dom0_mem=131072
  module /boot/vmlinuz-2.6-xen0 root=/dev/sda4 ro console=tty0

我的是这样的:

title Xen 2.0 / XenLinux 2.6
  kernel /boot/xen-2.0.gz dom0_mem=204800
  module /boot/vmlinuz-2.6-xen0 root=/dev/hdb1 ro console=tty0
  boot

注:
(1)。我的内存为256,我试dom0_mem=262144及往下一点的,提示内存不够,于是就改到200*1024=204800。
(2)。 在这次这前,以前通过apt安装的那个不知怎么的没有vmlinuz-2.6-xen0,无法启动,我将它换成了我当前在用的那个也无法启动。只好卸了。到http://www.xensource.com/downloads/
再下了一个2.0.7的想装上。安装命令如下:
# tar zxvf xen-2.0-install.tgz
# cd xen-2.0-install
# sh ./install.sh

提示Prerequisites 项目没装好,便接着再apt了iproute,bridge-utils,Twisted装上,再按上面的命令装,还是同样的提示,都灰心了,只好又回到重前apt安装xen。
然后进/boot里看了一下,发现里面多了好些个vmlinuz-2.6-xen0一类的文件,这在以前可是没看见的。感觉有点希望,于是按里面的vmlinuz-2.6-xen0再改了menu.lst.


3。祈祷!然后重启,选xen项,老天保佑,没想到顺利启动,并登录成功。


感觉最深的就是英语再好一点就好了,现在xen的中文资料极少,看着英文资料就着电子词典边看边查边猜边试,很是费力费时。感觉如果不是在debian下安装的话,可能要费更大的功夫,在debian下缺什么就apt安装什么就行了,如果要去找rpm包的话,那估计得麻烦很多。
发表于 2005-8-16 19:32:35 | 显示全部楼层
这个 vmlinuz-2.6-xen0  是给 Xen 虚拟机里的 Debian 用的...............

我想楼主误会了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-16 19:39:56 | 显示全部楼层
刚才把硬盘挂上了,不过不能显示中文。机子启动时选的是xen-2.6.11内核。操作如下:
#mount -t vfat /dev/hdxx /mnt/x
如果加上-o utf8 则中文显示为乱码,如加上-o codepage=936,iocharset=cp936则提示错误,但我机子原来就是这个参数挂载的,一直没有问题。iocharset=gb2312 或gbk都试过。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-16 19:43:14 | 显示全部楼层
呵呵,难怪了。华版主,能发个贴说一下这个Xen么,另能否给点这方面的链接呢,谢谢了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-16 20:18:25 | 显示全部楼层
Post by jhuangjiahua
这个 vmlinuz-2.6-xen0  是给 Xen 虚拟机里的 Debian 用的...............

我想楼主误会了

  

你看下这个,我把里面的一些复制了下来,
http://www.cl.cam.ac.uk/Research ... dmes/user/user.html

2.4 Configuration
Once you have built and installed the Xen distribution, it is simple to prepare the machine for booting and running Xen.

2.4.1 GRUB Configuration

An entry should be added to grub.conf (often found under /boot/ or /boot/grub/) to allow Xen / XenLinux to boot. This file is sometimes called menu.lst, depending on your distribution. The entry should look something like the following:


title Xen 2.0 / XenLinux 2.6
  kernel /boot/xen-2.0.gz dom0_mem=131072
  module /boot/vmlinuz-2.6-xen0 root=/dev/sda4 ro console=tty0

The kernel line tells GRUB where to find Xen itself and what boot parameters should be passed to it (in this case, setting domain 0's memory allocation in kilobytes and the settings for the serial port). For more details on the various Xen boot parameters see Section 8.2.

The module line of the configuration describes the location of the XenLinux kernel that Xen should start and the parameters that should be passed to it (these are standard Linux parameters, identifying the root device and specifying it be initially mounted read only and instructing that console output be sent to the screen). Some distributions such as SuSE do not require the ro parameter.

If you want to use an initrd, just add another module line to the configuration, as usual:

  module /boot/my_initrd.gz

As always when installing a new kernel, it is recommended that you do not delete existing menu options from menu.lst -- you may want to boot your old Linux kernel in future, particularly if you have problems.


3.3 Example: ttylinux

Ttylinux is a very small Linux distribution, designed to require very few resources. We will use it as a concrete example of how to start a Xen domain. Most users will probably want to install a full-featured distribution once they have mastered the basics3.1.

Download and extract the ttylinux disk image from the Files section of the project's SourceForge site (see http://sf.net/projects/xen/).
Create a configuration file like the following:

kernel = "/boot/vmlinuz-2.6-xenU"
memory = 64
name = "ttylinux"
nics = 1
ip = "1.2.3.4"
disk = ['file:/path/to/ttylinux/rootfs,sda1,w']
root = "/dev/sda1 ro"
Now start the domain and connect to its console:

xm create configfile -c
Login as root, password ro

我感觉vmlinuz-2.6-xenU才是给里面的虚拟机用的。英语不好,猜的成分居多。
回复 支持 反对

使用道具 举报

发表于 2005-8-16 21:07:02 | 显示全部楼层
你说的没错,Xen0 是给 domain0(相当于 root) 用的,XenU 是给 unprivileged domains 也就是虚拟的系统用的。

如果要体验 Xen,可以先下载它们提供的 DemoCD 来玩玩。
回复 支持 反对

使用道具 举报

发表于 2005-8-17 22:52:45 | 显示全部楼层
原来最近打算玩xen的大有人在。我这几天也在研究xen,不过不打算sarge上再跑个linux,想再跑个FreeBSD,看到国外有人在linux上跑NetBSD,觉得好有趣呀,我觉得这个才比较有意义,但是没看见有跑FreeBSD的,现在最重要的是无法获得FreeBSD的支持xen的内核,头痛呀。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-18 10:37:36 | 显示全部楼层
我主要是想找一下那种沙盒的感觉,具体我还不是很清楚怎么弄,这下面介绍的是在 Fedora Core 3下。知道Xen也就是从这样的一篇文章开始的。
Xeninux™ 内核的虚拟化技术简介 (1)
http://tech.ccidnet.com/pub/article/c743_a235821_p1.html

Xeninux™ 内核的虚拟化技术简介 (2)
http://tech.ccidnet.com/pub/article/c743_a235821_p2.html
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表