Can I chroot into a linux system from bsd? reddit / BSD ---------------------------------------------------------------------- itguysnightmare · 2023-10-08 05:32 I was planning to keep a stable OS on a partition to boot in case I need to fix my linux installation, I thought I could take two birds with one stone and install bsd to learn about it while also having that stable OS to use as a backup when needed. Would this be possible or should I stick to a stable linux distro instead? ---------------------------------------------------------------------- lvlint67 · 2023-10-08 05:55 I'm going to guess: no You could easily mount the filesystem and make any changes to config files/etc... But the bsd kernel and the Linux kernel are not the same. Some stuff MIGHT work... but I wouldn't count on much. Furthermore... almost the only time I find chroot useful when fixing a system.. is resetting a root password via the passed cmd. Most other things are available simple front mounting the file system, changing the config files and then booting into the system. ---------------------------------------------------------------------- parakleta · 2023-10-08 07:33 I do this on FreeBSD frequently to run programs that wont recompile on FreeBSD. It works fine for some things, less fine for others. See: https://docs.freebsd.org/en/books/handbook/linuxemu/ ---------------------------------------------------------------------- revhelix · 2023-10-08 07:59 There are also jails in FreeBSD.. you could try and finagle something there. Or you could make a VM ---------------------------------------------------------------------- itguysnightmare · 2023-10-08 08:34 That's a pity, thank you for your comment, it was helpful ---------------------------------------------------------------------- itguysnightmare · 2023-10-08 08:34 Gotcha, thanks for the link ---------------------------------------------------------------------- itguysnightmare · 2023-10-08 08:35 I'll look into jails, thanks! ---------------------------------------------------------------------- Is-Not-El · 2023-10-08 09:29 Yes and no. Let me explain, doing this on a traditional OS is quite impossible however a hypervisor with PCIE pass through would be able to do this. Something like Proxmox or ESXi can be installed on your hardware directly and you can install 3 VMs on it - Linux, FreeBSD and even Windows. Now the tricky part is how to connect physical monitor, keyboard and mouse to that setup? Well the easiest way is to have a physical KVM which is connected to the hypervisor and the hypervisor will be passing through USB and PCIE directly to the VMs. If you want to run the 3 VMs simultaneously you will need 3 GPUs at minimum or 1 DCs class GPU which is capable of being partitioned. If you don’t want to run the VMs simultaneously then you need just 1 GPU and 1 USB KVM. Keep in mind that this setup is very complicated to achieve but it’s possible. ---------------------------------------------------------------------- sp0rk173 · 2023-10-08 15:32 This isn’t true for FreeBSD where there’s a fully supported Linux binary compatibility layer ---------------------------------------------------------------------- laffer1 · 2023-10-08 18:28 You can run a Linux virtual machine inside bhyve on FreeBSD or MidnightBSD. Some BSDs also have linux emulation features that allow you to run some linux apps with files stored in /compat/linux however it is not running on a real linux kernel. ---------------------------------------------------------------------- Y3808 · 2023-10-09 01:37 This was marginally possible before systemd, but with systemd not really. ---------------------------------------------------------------------- revhelix · 2023-10-09 05:32 [https://docs.google.com/presentation/d/1lQhHD6semZ1XxvK8N7b40fWkt0Usg \_ScSIi2\_XPVmkk/edit?usp=sharing](https://docs.google.com/presentatio n/d/1lQhHD6semZ1XxvK8N7b40fWkt0Usg_ScSIi2_XPVmkk/edit?usp=sharing) ​ I presentation I did a while ago. I covered creating a linux jail with bastille (a tool).