当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 7 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 高手帮忙,如何在tty9启动x-window?
帖子发表于 : 2009-07-13 18:13 

注册: 2008-11-13 16:03
帖子: 817
送出感谢: 0 次
接收感谢: 0 次
debootstrap,chroot 后如何启动在tty9启动 x-window?

如果这样搞成功了,我想小白们会多起来的!!!


_________________
HP ProBook4321s,I3+ATI
OS : Fedora + Debian

http://box-look.org/


页首
 用户资料  
 
2 楼 
 文章标题 : Re: 高手帮忙,如何在tty9启动x-window?
帖子发表于 : 2009-07-14 16:23 

注册: 2008-11-13 16:03
帖子: 817
送出感谢: 0 次
接收感谢: 0 次
为怎么没人回呢?


_________________
HP ProBook4321s,I3+ATI
OS : Fedora + Debian

http://box-look.org/


页首
 用户资料  
 
3 楼 
 文章标题 : Re: 高手帮忙,如何在tty9启动x-window?
帖子发表于 : 2009-07-14 17:24 
头像

注册: 2008-07-23 19:06
帖子: 746
送出感谢: 0 次
接收感谢: 0 次
有什么用阿?


_________________
G.S.Alex's Blog


页首
 用户资料  
 
4 楼 
 文章标题 : Re: 高手帮忙,如何在tty9启动x-window?
帖子发表于 : 2009-07-14 17:44 
头像

注册: 2008-07-30 23:21
帖子: 13227
地址: freebuilder@yeah.net
系统: Debian stable AMD64
送出感谢: 36
接收感谢: 121
FreeBSD 很方便地修改 /etc/ttys ,Linux 没研究过,你自己看吧。


_________________
(2015-11-16 更新)适合 WM 的截图脚本
(2015-08-24 更新)Debian、Ubuntu 源列表说明
(2013-02-01 首发)文字如何绘出
▷▷ 【更 多 在 此】 ◁◁
箪食瓢饮随遇安,不求栋梁求参天。
【初韵】一门牛逼的编程语言。


页首
 用户资料  
 
5 楼 
 文章标题 : Re: 高手帮忙,如何在tty9启动x-window?
帖子发表于 : 2009-07-14 18:13 

注册: 2008-11-13 16:03
帖子: 817
送出感谢: 0 次
接收感谢: 0 次
放狗找了一下,按此操作应该可以成功的,发过来做个引记,以后有空就实践一下

There is a lot of interest lately in various virtualisation methods available for linux. These are very flexible and useful especially considering the CPU and memory resources of modern machines.

The venerable chroot virtualisation method is often overlooked though. chroot is a much simpler inbuilt mechanism to unix which can be used when the parallel environments can share the same kernel. Personally I use the chroot method to run an ubuntu (5.10) environment inside my fedora (4) system. I use it for various things, but mainly for developing debian packages on fedora.

Note I have a shared /home partition between fedora core 4 and ubuntu 5.10. This allows the two environments to share the same settings and data, whether they're running in a dual boot configuration, or running in parallel in a chroot configuration which this page discusses. It also allows me to upgrade or add new distributions independently of my data and settings. Since both environment's apps use the same settings from the shared /home partition, they need to be compatible. I haven't found this to be a problem, even with gnome versions 2.10 and 2.12 on redhat and fedora respectively.

The scenario I detail below is booting the system into fedora, and starting ubuntu in the chroot environment. To distinguish the commands used in both systems, I use green for fedora, and gray for ubuntu.
setting up an ubuntu text console
In an xterm (gnome-terminal) on fedora I do the following to create an ubuntu chroot.

引用:
sudo cp /etc/resolv.conf /ubuntu/etc/ #Make DNS available to ubuntu
sudo /usr/sbin/chroot /ubuntu #chroot to ubuntu root partition
mount /proc #make /proc virtual filesystem available
mount /sys #make /sys virtual filesystem available
mount /home #shared home partition between ubuntu and fedora
su - padraig #Change user from root to me
. /etc/environment && export LANG #need to explicitly set locale


For completeness going the other direction and starting a fedora chroot from ubuntu is done using

引用:
sudo cp /etc/resolv.conf /fedora/etc/ #Make DNS available to fedora
sudo chroot /ubuntu #chroot to ubuntu root partition
mount /proc #make /proc virtual filesystem available
mount /sys #make /sys virtual filesystem available
start_udev #make devices available in /dev
mount /home #shared home partition between ubuntu and fedora
su - padraig #Change user from root to me

A shell is usually all I use, but sometimes I would like to run X applications from within the chroot, which is discussed in the remaining sections.
starting ubuntu X applications on the fedora X server
To get ubuntu X apps to connect to fedora server one needs to enable TCP access to the fedora server. The handiest way to do that is to get ssh to setup the appropriate authorization and connections by doing the following on the fedora system

引用:
ssh -Y localhost

In the resulting shell, you can get the appropriate $DISPLAY variable to set in the ubuntu terminal by running the echo $DISPLAY command, and you set that in the ubuntu terminal as follows:

引用:
export DISPLAY=localhost:10.0


Any subsequent ubuntu X applications started, will display on fedora's X session.

Note to enable TCP access to the X server always, negating the need for the ssh session above, you can run the following and restart X

引用:
GDM_CONF=`find /etc -name gdm.conf 2>/dev/null`
sudo sed -i 's/#DisallowTCP=true/DisallowTCP=false/' $GDM_CONF

starting a separate ubuntu X server
Note I don't do this and I wouldn't really advise it due to the problems mentioned below, but I'm presenting this info anyway for completeness.

To start a completely new X session (on a new Virtual Terminal), use startx -- :1 &. Note to be able to do that from an xterm (the existing fedora X session) one needs to run on the ubuntu system:

引用:
sudo sed -i 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config


startx will allocate a new VT and start the X session on it. To switch between the original X session and the new one use CtrlAltF7 and CtrlAltF8 respectively. I noticed some problems with this though:

* startx doesn't deallocate the VT, hence subsequent runs will be on CtrlAltF9,F10,... The error is "Couldnt get a file descriptor referring to the console", "Exit 71 (EPROTO)". If one subsequently runs `deallocvt 8` you get the error "VT_DISALLOCATE: Device or resource busy"
* HAL does not start in the new gnome session and gnome-terminal spins the CPU on startup. Most other things seem to work fine though. The error is "Failed to initialise HAL!"
* Note the correct way to start multiple gnome sessions in parallel is by using the command gdmflexiserver -l. However I'm not sure if this can be used from the ubuntu session. I tried setting $DISPLAY to the fedora X server and running it, but got the error "Could not access GDM configuration file". Perhaps this is because of the differing locations of gdm.conf in /etc/ between ubuntu and fedora?

For a minimal X session one can at least do:

引用:
startx /usr/X11R6/bin/twm -- :1&


Some very quick twm usage notes:

* Click the desktop to start an xterm from which you can start other programs
* Click the desktop to select the "delete" option for apps that don't have means to exit (like fslint-gui)
* Note gnome-terminal works fine under twm


_________________
HP ProBook4321s,I3+ATI
OS : Fedora + Debian

http://box-look.org/


页首
 用户资料  
 
6 楼 
 文章标题 : Re: 高手帮忙,如何在tty9启动x-window?
帖子发表于 : 2009-07-14 18:30 

注册: 2008-11-13 16:03
帖子: 817
送出感谢: 0 次
接收感谢: 0 次
BigSnake.NET 写道:
没有 tty9, 也没有 tty7



关键是要同时运行主系统 和chroot系统的x-window, 一个tty7不够用啊!!!!

tty7 运行主系统的x-window
tty8 当chroot 的控制台
tty9 运行chroot的 x-window


_________________
HP ProBook4321s,I3+ATI
OS : Fedora + Debian

http://box-look.org/


页首
 用户资料  
 
7 楼 
 文章标题 : Re: 高手帮忙,如何在tty9启动x-window?
帖子发表于 : 2009-07-17 7:51 

注册: 2008-11-13 16:03
帖子: 817
送出感谢: 0 次
接收感谢: 0 次
没人顶么?


_________________
HP ProBook4321s,I3+ATI
OS : Fedora + Debian

http://box-look.org/


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 7 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 4 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译