schroot

来源:互联网 发布:淘宝众筹是什么意思 编辑:程序博客网 时间:2024/06/05 16:02

参考的这篇博客地址是 http://forum.ubuntu.org.cn/viewtopic.php?t=376479


https://help.ubuntu.com/community/DebootstrapChroot

http://jacky.aiwaly.com/wp/schroot-chro ... users.html
https://help.ubuntu.com/community/BasicChroot
http://wiki.debian.org/Schroot


一、基本工具及配置、用法
1. 安装工具
$ sudo apt-get install debootstrap schroot

2. 提高安全性及避免用户配置混淆
$ sudo editor /etc/schroot/mount-defaults
注释掉/home的挂载

3. 进入系统的方法
普通用户:schroot -c XXX
管理权限:sudo schroot -c XXX 或 schroot -c XXX -u root

4. 另一种安装软件的方法
$ sudo schroot -c XXX apt-get install YYY
例如:
$ sudo schroot -c lucid apt-get install nano
$ sudo schroot -c precise apt-get install nano


5.查看虚拟环境

schroot -l

二、安装32位 Ubuntu Precise(Ubuntu 12.04)
1. 编辑配置:sudo editor /etc/schroot/chroot.d/precise.conf,添加如下内容
[precise]
description=Ubuntu Precise 32Bit
type=directory
directory=/srv/chroot/precise
users=loaden
groups=users
root-groups=root
personality=linux32

2. 在/32目录安装32位系统
$ sudo debootstrap --arch i386 precise /srv/chroot/precise http://mirrors.163.com/ubuntu/
$ sudo chmod 777 /srv/chroot/precise/home
$ mkdir /srv/chroot/precise/home/loaden

3. 执行:sudo schroot -c precise 进入系统
a. 更新源
# echo "deb http://mirrors.163.com/ubuntu precise main universe" > /etc/apt/sources.list
# apt-get update
b. 语言支持
# locale-gen en_US.UTF-8 zh_CN.UTF-8
c. 时区
# dpkg-reconfigure tzdata
d. 自动完成
# apt-get install bash-completion
e. 字体
# apt-get install ttf-wqy-*
f. 图形界面
# apt-get install libgtk2.0-0 libgtk-3-0 appmenu-gtk appmenu-gtk3
# echo "export DISPLAY=:0.0" > /etc/profile.d/gui_support.sh

6. 以普通权限进入32位系统
a. 安装FoxReader
$ sudo dpkg -i FoxitReader_1.1.0_i386.deb
$ sudo apt-get install libcanberra-gtk-module
b. 安装glGo
$ sudo dpkg -i glGo-1.4.1.deb
$ sudo apt-get install libsm6 libjpeg62 libsdl-image1.2 libsdl-ttf2.0-0 libsdl-mixer1.2 libglu1-mesa libpython2.7 gnugo
$ sudo ln -s /usr/lib/libpython2.7.so.1.0 /usr/lib/libpython2.5.
so.1.0


注意:chroot安装完后是没有内核的:所以需要自己手动下载相应版本的内核进行安装,这个暂时我还没有实验


二、安装32位 Ubuntu Lucid
1. 编辑配置:sudo editor /etc/schroot/chroot.d/lucid.conf,添加如下内容
[lucid]
description=Ubuntu Lucid 32Bit
type=directory
directory=/srv/chroot/lucid
users=loaden
groups=users
root-groups=root
personality=linux32

2. 在/32目录安装32位系统
$ sudo debootstrap --arch i386 lucid /srv/chroot/lucid http://mirrors.163.com/ubuntu/
$ sudo chmod 777 /srv/chroot/lucid/home
$ mkdir /srv/chroot/lucid/home/loaden
$ ln -s ~ /srv/chroot/lucid/home/loaden/.host

3. 执行:sudo schroot -c lucid 进入系统
a. 更新源
# echo "deb http://mirrors.163.com/ubuntu lucid main universe" > /etc/apt/sources.list
# apt-get update
b. 语言支持
# locale-gen en_US.UTF-8 zh_CN.UTF-8
c. 时区
# dpkg-reconfigure tzdata
d. 自动完成
# apt-get install bash-completion
e. 字体
# apt-get install ttf-wqy-*
f. 图形界面
# apt-get install libgtk2.0-0
# echo "export DISPLAY=:0.0" > /etc/profile.d/gui_support.sh

6. 以普通权限进入32位系统
a. 安装FoxReader
$ sudo dpkg -i FoxitReader_1.1.0_i386.deb
$ sudo apt-get install libcanberra-gtk-module
b. 安装glGo
$ sudo dpkg -i glGo-1.4.1.deb
$ sudo apt-get install libsm6 libjpeg62 libsdl-image1.2 libsdl-ttf2.0-0 libsdl-mixer1.2 libglu1-mesa libpython2.6 gnugo
$ sudo ln -s /usr/lib/libpython2.6.so.1.0 /usr/lib/libpython2.5.so.1.0

0 0
原创粉丝点击