From owner-freebsd-jail@FreeBSD.ORG Sun Jul 20 08:20:31 2008 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DED921065671 for ; Sun, 20 Jul 2008 08:20:31 +0000 (UTC) (envelope-from mikhailg@webanoide.org) Received: from smtp.tal.navalradio.cl (smtp.tal.navalradio.cl [201.236.67.155]) by mx1.freebsd.org (Postfix) with ESMTP id 6B0BB8FC0C for ; Sun, 20 Jul 2008 08:20:31 +0000 (UTC) (envelope-from mikhailg@webanoide.org) Received: from [172.18.96.244] ([172.18.96.244]) (authenticated bits=0) by smtp.tal.navalradio.cl (8.13.8/8.13.8) with ESMTP id m6K8HnJM002545 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 20 Jul 2008 08:17:57 GMT (envelope-from mikhailg@webanoide.org) Message-ID: <4882F53C.6060604@webanoide.org> Date: Sun, 20 Jul 2008 04:20:12 -0400 From: Mikhail Goriachev Organization: Webanoide User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: =?UTF-8?B?0JXQstCz0LXQvdC40Lkg0KjQsNC/0L7QstCw0Ls=?= , freebsd-jail@freebsd.org References: <488233B0.1000904@webanoide.org> <48825D18.1010001@webanoide.org> <48828965.5000802@webanoide.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Subject: Re: getpwnam: root: No such file or directory X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2008 08:20:32 -0000 Евгений Шаповал wrote: > Thanks! > >> You can't just add the root account. The jail/system should already come >> with everything. It seems like you didn't populate the jail, that is why >> there are many missing pieces. >> >> What steps did you take to make your jail? > > 1. download freebsd sources > 2. build jail, I use this script: > =================================================== > #!/bin/sh > > case "$2" in > create) > jail_dir="$1" > mkdir -p ${jail_dir} > cd /usr/src > mkdir -p ${jail_dir} > make world DESTDIR=${jail_dir} > cd /usr/src/etc ^^^^^^^^^^^^^^^ You should not change into /usr/src/etc. Remove that line from the script. > make distribution DESTDIR=${jail_dir} This is the line that populates most of your jail but it fails because it is executed from /usr/src/etc instead of /usr/src. That is why you get missing pieces. So part of your script should look something like: mkdir -p ${jail_dir} cd /usr/src make installworld DESTDIR=${jail_dir} make distribution DESTDIR=${jail_dir} mount_devfs devfs ${jail_dir}/dev You should read the Jails section in the Handbook and also the man page for jail for further details. http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html Regards, Mikhail. -- Mikhail Goriachev Webanoide