jails Thick Jail with Ubuntu Bionic as Guest

I am attempting to run a thick jail with Ubuntu Bionic as guest. I get this error:

# service jail start phonedev
Starting jails: cannot start jail "phonedev":
13
jail: phonedev: getpwnam: No such file or directory
jail: phonedev: /bin/true: failed
.

The host is FreeBSD 15.0. I installed this guest using debootstrap. I am able to 'chroot /compat/ubuntu /bin/bash' and run simple programs. I presume this means that FreeBSD host is properly configured to run linux binaries.

I am aware of https://forums.freebsd.org/threads/jail-getpwnam-no-such-file-or-directory.71635/ . The solution to use pwd_mkdb is no longer applicable. I have run pwconv and grpconv.

The jail starting process doesn't seem to kick off any logging within the jail. I couldn't find(1) any files that were touched after attempting to start the jail.

Ubuntu Bionic is a prerequisite to Android Open Source development. I would very much prefer to run in virtualization if I can figure this out.
 
Are you able to chroot into that instead? I.e:

# chroot /path/to/phonedev

A little less secure than a Jail but doesn't need to be a long term thing but useful to help diagnose if the Linux Emulation is working correctly before we diagnose Jail issues.

Ubuntu Bionic is a prerequisite to Android Open Source development. I would very much prefer to run in virtualization if I can figure this out.
Neither chroot or jail is virtualization. VirtualBox generally has pretty decent usb passthrough. You can also get adb to listen on a TCP port too if passthrough is very broken. I believe Bhyve has passthrough too but it requires the whole bus.

I use a Gentoo Stage3 tarball for Android and Zephyr development, I don't recall any issues with this. But I am on a much older FreeBSD release.
 
I made some forward progress. From man(8) jail, setting exec.system_jail_user=true allowed a jail to be created and to persist without the getpwbynam error. It seems there is something wrong with the passwd system inside the jail, but I can't figure it out. Using the passwd database on the host worked for reasons I don't really understand.

I was able to jexec JID /bin/bash to enter that jail, which was a ghosttown inside with no running processes. It was not much different than a chroot environment.

Now I need to figure out how to make init/systemd to do it's thing inside the jail. More to follow.
 
Glad to hear you have it mostly working. I think for i.e android development you won't need the default services to be running.
That said, I only really know how to start them on FreeBSD jails. For Linux jails I tend to only mount required (virtual) filesystems and run development related programs.
 
Back
Top