# FreeBSD 9.1 jail: cannot open tty-output



## thekeymaker (Mar 24, 2013)

Hi everyone,

I just got this problem and let me give you some background.  I just did a new install of *FreeBSD 9.1* and am using *zfs as root*.  I made a base jails, and cloned that jail to create different web services.  I have one jail running currently on this machine and have cloned the base again to start creating another service.  The first jail is run at startup with the following code in my rc.conf:


```
# Jail Setup 
jail_enable="YES"
jail_list="owncloud"
jail_owncloud_rootdir="/usr/jails/owncloud"
jail_owncloud_hostname="noreal.example.com"
jail_owncloud_ip="192.168.xx.yy"
jail_owncloud_interface="re0"
jail_owncloud_devfs_enable="YES"
jail_owncloud_exec_start="/bin/sh /etc/rc"
jail_owncloud_exec_stop="/bin/sh /etc/rc.shutdown"
```

The second jail I use the following command to work on it:


```
ifconfig re0 inet 192.168.xx.ww netmask 255.255.255.255 alias

jail -c path=usr/jails/wordpress mount.devfs host.hostname=fbsd ip4.addr=192.168.xx.ww command=/bin/sh
```

Now when I try to build an port I don't get the ncurses configuration screen and instead get this: 


```
cannot open tty-output
```

I believe the issue is that this second jail does not have /dev/pts/? populated.  On the first jail everything works fine and /dev/pts is populated with /dev/pts/0.  

I guess I am a little confused on how the PTS's are suppose*d* to work and if they are suppose*d* to be mapped to both jails?  Or can only one jail use it at a time?  I'm sure I am just overlooking something and I appreciate any help in the right direction!

~thekeymaker


----------



## thekeymaker (Mar 24, 2013)

Looks like it could be a bug:

http://freebsd.1045724.n5.nabble.com/new-jail-8-ignoring-devfs-ruleset-td5787347.html

I am going to try as the link suggest and move my jail commands from rc.conf to jail.conf. I will post back once I get this converted and keep you updated on my progress.


----------



## thekeymaker (Mar 24, 2013)

Yay I solved my problem!  I would recommend anyone having the same problem reading the link I posted about.  Basically I did as stated in the post and listed about and it creates the right /dev files for both jails. To be complete I commented out everything I listed above in rc.conf and created /etc/jail.conf.  My /etc/jail.conf contains the following:


```
owncloud {
     path = /usr/jails/owncloud;
     mount.devfs;
     host.hostname = hostname.example.net;
     ip4.addr = 192.168.15.27;
     interface = re0;
     exec.start = "/bin/sh /etc/rc";
     exec.stop = "/bin/sh /etc/rc.shudown";
}
```

Most of this is taken from the jail(8) man pages.  To start the first jail I just ran the following command:

[cmd=]jail -c owncloud[/cmd]

Now I just need to find out how to start this jail at boot.  I'm sure I can find the answer to that myself but if someone would like to post that, that would be great!

Hope this helps someone!


----------



## urosgruber (Mar 24, 2013)

There is a new port sysutils/jail2. It might help you with that.


----------

