zeissoctopus 发表于 2012-07-13 23:21

PC-BSD 9.1 提供的 Linux jail

本帖最后由 zeissoctopus 于 2012-07-13 23:22 编辑

PC-BSD 9.1 的 Warden 提供 Linux jail。 暫時支援直接安裝 debian 6.0.x。

PC-BSD Warden Wiki

ulovko 发表于 2012-07-14 07:29

@zeissoctopus 感谢分享最新消息 ^_^ :emn31:

fender0107401 发表于 2012-07-14 10:25

这下牛逼毁了。。。

muwanqing_cu 发表于 2012-07-14 13:50

有啥牛逼的???

lsstarboy 发表于 2012-07-14 20:12

呵呵,连操作系统都是混合动力了。

xooass 发表于 2012-07-14 20:18

安装?

能安装OS的话还算是jail么

zeissoctopus 发表于 2012-07-14 21:23

xooass 发表于 2012-07-14 20:18 static/image/common/back.gif
安装?

能安装OS的话还算是jail么

Linux jail 裡的 debian 是用 FreeBSD Host 的 File system, 因此 Linux jail 並不是虛擬機。

xooass 发表于 2012-07-15 13:47

本帖最后由 xooass 于 2012-07-16 09:56 编辑

不错非常感兴趣应该是debian kFreeBSD内核版本的,



freebsd# cd /usr/ports/sysutils/debootstrap
freebsd# make install clean
freebsd# rehash


Create a directory for the jail, you may create this as a ZFS dataset, too.
freebsd# mkdir -p /jail/debian


Load necessary kernel modules:
freebsd# kldload fdescfs linprocfs linsysfs tmpfs
NOTE: Add these to /boot/loader.conf to run the jail on startup


Create a Debian (squeeze) distribution in the directory using debootstrap
freebsd# debootstrap squeeze /jail/debian http://cdn.debian.net/debian

Unmount filesystems mounted by debootstrap:
freebsd# umount /jail/debian/sys
freebsd# umount /jail/debian/dev/fd /jail/debian/dev
freebsd# umount /jail/debian/proc

Mount necessary filesystems:
freebsd# mount -t linprocfs linprocfs /jail/debian/proc
freebsd# mount -t linsysfs linsysfs /jail/debian/sys
freebsd# mount -t tmpfs tmpfs /jail/debian/lib/init/rw
NOTE: Add the filesystems to /etc/fstab to run the jail on startup, see "man fstab"

Configure the jail in your /etc/rc.conf, you may follow this example:
jail_enable="YES"
jail_list="debian"
jail_debian_rootdir="/jail/debian"
jail_debian_hostname="debian.home"
jail_debian_ip="127.0.0.1"
jail_debian_devfs_enable="YES"
jail_debian_exec_start="/etc/init.d/rc 3"
jail_debian_flags="-l -u root"

Replace 127.0.0.1 with an IP address on your system and debian.home with your desired jail hostname.

Edit /jail/debian/etc/resolv.conf or you may use your system resolv.conf, if you want:
freebsd# cp /etc/resolv.conf /jail/debian/etc/resolv.conf

Run your new jail (the /etc/rc.jail script starts rsyslog, cron and sshd inside the jail)
freebsd# /etc/rc.d/jail start debian

Use jls(8) to get the JID of your jail and jexec(8) to run /bin/bash inside:
freebsd# jls
JIDIP AddressHostname   Path
1127.0.0.1   debian.home/jail/debian

freebsd# jexec 1 /bin/bash

Verify that you are under debian now:
root@debian:/# uname
GNU/kFreeBSD

Adjust your debian mirror in /etc/apt/sources.list (base system /jail/debian/etc/apt/sources.list)
Have fun with Debian GNU/kFreeBSD in a FreeBSD jail! (functionality may be limited)
页: [1]
查看完整版本: PC-BSD 9.1 提供的 Linux jail