Hot answers tagged

13 votes
Accepted

Start a systemd service inside chroot from a non systemd based rootfs

Several years later I must admit there is only one solution to most Systemd practical problems. Because the error is Systemd itself I am really fed up with Systemd as I had problems that I never faced ...
10 votes

Fixing '/dev/null: Permission denied' repeatedly in chroot

The disk might be mounted with the nodev option, which mount interprets thusly: Do not interpret character or block special devices on the file system. You can verify this by checking the output ...
ash's user avatar
  • 291
6 votes

schroot build environment setup how to avoid bind-mount home

I recommend a different solution (my previous answer). You can use different fstab for different jails. You could specify filesystem table file by editing schroot conf file. For example, if you add ...
Tianren Liu's user avatar
6 votes
Accepted

Fake /proc/cpuinfo when using chroot

Copy the file to a regular filesystem, edit according to your needs, then mount --bind the edited file over the original. mount --bind /tmp/cpuinfo.txt /proc/cpuinfo It'll only lie to the software &...
u1686_grawity's user avatar
6 votes

grub-install hangs when rescuing a linux install via chroot

The simple answer to this question is to make sure /run is mounted via bind. I.e for a chroot to work correctly, the following mounts are required: mount -t proc /proc /mnt/chroot/proc mount -o bind ...
Peter Brooks's user avatar
6 votes

Is fakechroot a security flaw?

Some Linux applications will only work if the current user is root. Most of these applications relate to changing Linux itself, so are protected from ordinary users. However, sometimes, when working ...
harrymc's user avatar
  • 476k
5 votes
Accepted

Why do I have to specify DNS when using chroot?

Isn't DHCP only the way my router gives me IP? No, it's also the way your router gives you extra information – gateway IP, DNS server IP, default domain name, time server IP, et cetera. Why I can ...
u1686_grawity's user avatar
4 votes
Accepted

CentOS SFTP chroot

It looks like the permissions for the chroot directory, /home/sftp/comege, are not set to allow read access by the comege user. Permissions on /home/sftp/comege should look like this: # ls -la /home/...
Stephen Balousek's user avatar
4 votes
Accepted

Error starting node.js localserver - undefined EventEmitter prototype

process.EventEmitter was deprecated and not working in new node version https://github.com/LearnBoost/websocket.io/issues/55
br.'s user avatar
  • 156
3 votes
Accepted

need clarifications on chroot command

You should run chroot /home/vignesh/my_chroot/ /bin/bash. The first argument is where to chroot and the second the command. The path of the command is relative to where you chroot.
pim's user avatar
  • 772
3 votes
Accepted

nano command not found after entering chroot during arch install

Currently Arch Linux repositories have a much different 'base' group than before, which now only includes the bare minimum required for all installation types (including VMs and minimal "containers"), ...
u1686_grawity's user avatar
3 votes
Accepted

What is meant by "don't run processes as root in a chroot environmentl"

Although you need to invoke chroot as root, the chroot option --userspec=USER:GROUP will run the command under the non-root UID/GID. A more recent way to chroot without root-permissions is with the ...
harrymc's user avatar
  • 476k
2 votes

How to Access `/dev` From Inside a `chroot` Jail?

MacOS has a special filesystem called devfs which can be mounted in multiple places. Just mount it inside your chroot jail, like so: sudo mount -t devfs devfs "$jail"/dev
sah's user avatar
  • 121
2 votes

mount dev, proc, sys in a chroot environment?

I was trying to reset the grub password on my laptop via a live USB, so I needed to use chroot as well. The target system was Ubuntu 16.04 and I was working off an Elementary live USB. These commands ...
icedwater's user avatar
  • 147
2 votes

mount dev, proc, sys in a chroot environment?

It may be worth noting in this popular question, that Arch Linux has made a script arch-chroot; download arch-install-scripts-15-1-any.pkg.tar.xz This which takes care of various related problems ...
y guy's user avatar
  • 31
2 votes
Accepted

How to chroot Arch from a Gentoo live cd?

That’s really easy. The arch-chroot script does the following: chroot_setup() { CHROOT_ACTIVE_MOUNTS=() [[ $(trap -p EXIT) ]] && die '(BUG): attempting to overwrite existing EXIT trap' ...
Daniel B's user avatar
  • 62.6k
2 votes

Start a systemd service inside chroot from a non systemd based rootfs

Faced this problem once tried to bring up network in rescue mode using network configuration from chroot. Finally this works for me: service --skip-redirect <service> restart or: ...
reddot's user avatar
  • 398
2 votes
Accepted

How to access system clipboard from a chroot environment?

This is indeed a problem with X server. Arch Wiki on chroot explains how this can be done. Specifically: xhost +local: Make sure that vim is compiled with +clipboard option.
Nishant's user avatar
  • 745
2 votes
Accepted

chroot erase and overwrite the rootfs. Is it possible to mount a copy of /proc and /sys?

But /proc and /sys are part of the rootfs. No they're not. They're also temporary filesystems – even more than that, they're completely virtual filesystems. The boot process just needs to mount an ...
u1686_grawity's user avatar
2 votes
Accepted

Connect with a user in SFTP and SSH

Subsystem sftp internal-sftp Match Group sftp ChrootDirectory /home/test/ ForceCommand internal-sftp AllowTCPForwarding no X11Forwarding no This configuration is common for restricting ...
Kenster's user avatar
  • 7,749
2 votes

How to create SFTP user with specified directory permissions

the user doesn't see his own home folder (/home/example.com) Yes and no. The directive ChrootDirectory %h makes the real /home/example.com appear as / to the user. The user sees this /, so he kinda ...
Kamil Maciorowski's user avatar
1 vote

virtualbox snapshot - is it a safe back-up if I want to over-write (dd to) sda1?

Well.... in case anyone was interested - the answer is yes! (I just tried it after making a complete backup of my VM)... nice job Virtualbox :)
code_fodder's user avatar
  • 1,531
1 vote

How to run docker inside chroot

You failed to start docker because of that, when running in chroot, the system isn't fully booted. The process that manages services isn't running, so systemctl command ignores your start requests. I ...
JXQ's user avatar
  • 11
1 vote
Accepted

chroot an user to more than one directory in different locations

No, chroot won't help here. I think acl is what you're looking for, but he will still have at least read access to the rest of the file system. chrootis very powerful but it practically defines a new ...
gmelis's user avatar
  • 677
1 vote
Accepted

Can not login through ssh on my machine

Actually I dont think what you are asking is possible. From the sshd_config manual: ChrootDirectory Specifies the pathname of a directory to chroot(2) to after authentication. At ...
Peter's user avatar
  • 198
1 vote
Accepted

su in Debian chroot gives critical error (embedded system)

After installing the same Debian jessie in another NAS with a newer kernel and seeing it worked, I managed to identify the culprit by comparing the files in /etc/pam.d/: it's pam_limits.so (inside the ...
virtualdj's user avatar
  • 266
1 vote

How to upstart Debian Chroot on Synology to run Homebridge

You start the services in the Debian-Chroot evironment from the DSM task scheduler. The GUI of the chroot app is broken in DSM6, so you have to work around it at the moment. Services information is ...
dfrap's user avatar
  • 11
1 vote
Accepted

/bin/bash (chrooted) no longer works

To solve my problem, essentially chroot was reinstalled. I had another guy who knows way more than me do it, but I did ask him to try to summarize what he did so it might help anyone else who has to ...
Ultra Graphics's user avatar
1 vote
Accepted

How to drop privileges in a Debian Chroot?

I assume that the reason for the error is that the user exists in the old file system, but not the new one that you have changed to with chroot. If I knew exactly where all the user details are held, ...
AFH's user avatar
  • 17.5k
1 vote

how to mount chroot /proc on ubuntu start

thanks to @andlrc, this has solved the problem using the fstab: hope someone get used of it fstab or file system table is used by the system to get information about partitions to automatically mount ...
Ali Kanaan's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible