sed -i "s|^\(eval.\+\)$|#\1|g" /home/pi/vdesktop/vdesktop pi@raspberrypi4:~ $ sed -i "s|^\(export DISPLAY.\+\)$|#\1|g" /home/pi/vdesktop/profile pi@raspberrypi4:~ $ sed -i "s|^\(eval.\+\)$|#\1|g" /home/pi/vdesktop/profile pi@raspberrypi4:~ $ sed -i "s|^\(sleep.\+\)$|#\1|g" /home/pi/vdesktop/profile pi@raspberrypi4:~ $ sed -i "s|^\(lxpanelctl.\+\)$|#\1|g" /home/pi/vdesktop/profile pi@raspberrypi4:~ $ ls -l /media/netdir/source/raspberrypi total 0 drwxrwxrwx+ 1 systemd-network users 18 Dec 6 19:53 3 drwxrwxrwx+ 1 pi pi 18 Dec 30 09:59 4-01 drwxrwxrwx+ 1 pi pi 18 Dec 30 15:26 4-02 drwxrwxrwx+ 1 pi pi 18 Dec 30 20:46 4-03 drwxrwxrwx+ 1 systemd-timesync 98 18 Dec 31 15:39 4-04 drwxrwxrwx+ 1 99 99 18 Jan 1 21:05 4-05 drwxrwxrwx+ 1 99 99 18 Jan 2 08:03 4-06 drwxrwxrwx+ 1 99 99 18 Dec 29 09:27 4-10 drwxrwxrwx+ 1 pi pi 18 Dec 29 18:21 4-11 drwxrwxrwx+ 1 pi pi 18 Dec 29 19:19 4-12 drwxrwxrwx+ 1 pi pi 18 Dec 29 22:21 4-13 drwxrwxrwx+ 1 pi pi 18 Dec 29 22:30 4-14 drwxrwxrwx+ 1 pi pi 18 Dec 20 18:51 4-8 drwxrwxrwx+ 1 pi pi 18 Dec 21 21:14 4-9 drwxrwxrwx+ 1 99 99 18 Dec 6 19:46 org pi@raspberrypi4:~ $ mkdir -p /media/netdir/source/raspberrypi/4-06 pi@raspberrypi4:~ $ inset_line=`grep -n systemd-nspawn /home/pi/vdesktop/vdesktop | tail -1 | cut -f 1 -d:` pi@raspberrypi4:~ $ let inset_line2=inset_line+1 pi@raspberrypi4:~ $ sed -i "${inset_line2}iumount \${mntpnt}/mnt/compile" /home/pi/vdesktop/vdesktop pi@raspberrypi4:~ $ sed -i "${inset_line}imount --bind /media/netdir/source/raspberrypi/4-06 \${mntpnt}/mnt/compile" /home/pi/vdesktop/vdesktop pi@raspberrypi4:~ $ sed -i "${inset_line}imkdir -p \${mntpnt}/mnt/compile" /home/pi/vdesktop/vdesktop pi@raspberrypi4:~ $ ls -l /mnt/runimg total 47169196 -rwxrwxrwx+ 1 systemd-network users 1939865600 Dec 21 22:50 2012-07-15-wheezy-raspbian.img -rwxrwxrwx+ 1 systemd-network users 1939865600 Dec 21 00:08 2013-02-09-wheezy-raspbian.img -rwxrwxrwx+ 1 systemd-network users 2962227200 Dec 20 23:26 2013-12-20-wheezy-raspbian.img -rwx------+ 1 99 99 8956451117 Jan 1 23:29 2017-07-05-raspbian-jessie_compile-armel.img -rwxrwxrwx+ 1 99 99 4555014144 Dec 31 22:50 2019-04-08-raspbian-stretch_chroot.img -rwxrwxrwx+ 1 systemd-timesync 98 3481272320 Dec 30 11:47 2019-04-08-raspbian-stretch-make-new.img -rwxrwxrwx+ 1 root root 3481272320 Dec 30 09:55 2019-04-08-raspbian-stretch-make-old.img drwxrwxrwx+ 1 root root 160 Dec 19 22:41 bak -rw-r--r--+ 1 systemd-timesync 98 867172352 Dec 27 22:23 Debian-testing-armmp_2019-12-27T221219.img -rw-r--r--+ 1 99 99 764411904 Dec 23 10:06 Raspbian-stretch-rpix_2019-12-22T225115.img -rw-rw-rw-+ 1 99 99 8589934592 Jan 1 19:02 raspi-test-armel.img -rw-rw-rw-+ 1 99 99 2173698048 Jan 2 09:47 test2.img -rw-rw-rw-+ 1 99 99 8589934592 Jan 1 23:45 test.img pi@raspberrypi4:~ $ sudo /home/pi/vdesktop/vdesktop /mnt/runimg/test2.img OK, looks like you specified an .img file. e2fsck 1.44.5 (15-Dec-2018) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/loop0: 27799/130560 files (0.2% non-contiguous), 219184/522240 blocks /mnt/runimg/test2.img mounted on /mnt/virtualdesktop Your cursor color will be blue until the container is terminated. Booting in 5 seconds. Spawning container virtualdesktop on /mnt/virtualdesktop. Press ^] three times within 1s to kill container. systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR) Detected virtualization 'systemd-nspawn'. Detected architecture 'arm'. Welcome to Debian GNU/Linux 8 (jessie)! Set hostname to . Failed to install release agent, ignoring: No such file or directory Cannot add dependency job for unit dbus.socket, ignoring: Unit dbus.socket failed to load: No such file or directory. Cannot add dependency job for unit display-manager.service, ignoring: Unit display-manager.service failed to load: No such file or directory. [ OK ] Reached target Remote File Systems (Pre). [ OK ] Reached target Encrypted Volumes. [ OK ] Reached target Paths. [ OK ] Reached target Swap. [ OK ] Created slice Root Slice. [ OK ] Created slice User and Session Slice. [ OK ] Listening on Delayed Shutdown Socket. [ OK ] Listening on /dev/initctl Compatibility Named Pipe. [ OK ] Listening on Journal Socket (/dev/log). [ OK ] Listening on Journal Socket. [ OK ] Created slice System Slice. [ OK ] Created slice system-getty.slice. [ OK ] Listening on Syslog Socket. [ OK ] Reached target Sockets. Mounting FUSE Control File System... Starting Copy rules generated while the root was ro... Starting Journal Service... [ OK ] Started Journal Service. [ OK ] Reached target Slices. Starting Remount Root and Kernel File Systems... [ OK ] Mounted FUSE Control File System. [ OK ] Started Remount Root and Kernel File Systems. Starting Various fixups to make systemd work better on Debian... Starting Load/Save Random Seed... [ OK ] Reached target Local File Systems (Pre). [ OK ] Reached target Local File Systems. Starting Create Volatile Files and Directories... [ OK ] Reached target Remote File Systems. Starting Trigger Flushing of Journal to Persistent Storage... [ OK ] Started Copy rules generated while the root was ro. [ OK ] Started Load/Save Random Seed. Starting LSB: Raise network interfaces.... [ OK ] Started Various fixups to make systemd work better on Debian. [ OK ] Started Trigger Flushing of Journal to Persistent Storage. [ OK ] Started Create Volatile Files and Directories. Starting Update UTMP about System Boot/Shutdown... [ OK ] Started Update UTMP about System Boot/Shutdown. [ OK ] Started LSB: Raise network interfaces.. [ OK ] Reached target Network. [ OK ] Reached target System Initialization. [ OK ] Reached target Timers. [ OK ] Reached target Basic System. Starting Regular background program processing daemon... [ OK ] Started Regular background program processing daemon. Starting /etc/rc.local Compatibility... Starting System Logging Service... Starting Permit User Sessions... Starting Cleanup of Temporary Directories... [ OK ] Started Permit User Sessions. [ OK ] Started Cleanup of Temporary Directories. [ OK ] Started System Logging Service. [ OK ] Started /etc/rc.local Compatibility. Starting Console Getty... [ OK ] Started Console Getty. [ OK ] Reached target Login Prompts. [ OK ] Reached target Multi-User System. [ OK ] Reached target Graphical Interface. Starting Update UTMP about System Runlevel Changes... [ OK ] Started Update UTMP about System Runlevel Changes. Debian GNU/Linux 8 nas-27-5A-1D console nas-27-5A-1D login: pi Password: Login incorrect nas-27-5A-1D login: manager Password: Login incorrect nas-27-5A-1D login: mana Login timed out after 60 seconds. Debian GNU/Linux 8 nas-27-5A-1D console nas-27-5A-1D login: manager Password: Login incorrect nas-27-5A-1D login: root Password: Login incorrect nas-27-5A-1D login: root Password: Login incorrect nas-27-5A-1D login: Login timed out after 60 seconds. Debian GNU/Linux 8 nas-27-5A-1D console nas-27-5A-1D login: root Password: Login incorrect nas-27-5A-1D login: Login timed out after 60 seconds. Debian GNU/Linux 8 nas-27-5A-1D console nas-27-5A-1D login: manager Password: Login incorrect nas-27-5A-1D login: jin Password: Login incorrect nas-27-5A-1D login: ^]^]^]^]^]^]^H^H^H^H^H^H^H Password: Login incorrect nas-27-5A-1D login: ^]^] Container virtualdesktop terminated by signal KILL. pi@raspberrypi4:~ $ pi@nas-27-5A-1D:ls -l -bash: pi@nas-27-5A-1D:ls: command not found pi@raspberrypi4:~ $ echo 00:00:00 00:00:00 pi@raspberrypi4:~ $ pi@nas-27-5A-1D:date -bash: pi@nas-27-5A-1D:date: command not found pi@raspberrypi4:~ $ compile finish -bash: compile: command not found pi@raspberrypi4:~ $ shutdown -h now Failed to set wall message, ignoring: Interactive authentication required. Failed to power off system via logind: Interactive authentication required. Failed to open initctl fifo: Permission denied Failed to talk to init daemon. pi@raspberrypi4:~ $ sed -i "s|^#\+\(eval.\+\)$|\1|g" /home/pi/vdesktop/vdesktop pi@raspberrypi4:~ $ sed -i "s|^#\+\(export DISPLAY.\+\)$|\1|g" /home/pi/vdesktop/profile pi@raspberrypi4:~ $ sed -i "s|^#\+\(eval.\+\)$|\1|g" /home/pi/vdesktop/profile pi@raspberrypi4:~ $ sed -i "s|^#\+\(sleep.\+\)$|\1|g" /home/pi/vdesktop/profile pi@raspberrypi4:~ $ sed -i "s|^#\+\(lxpanelctl.\+\)$|\1|g" /home/pi/vdesktop/profile pi@raspberrypi4:~ $ sed -i "${inset_line}d" /home/pi/vdesktop/vdesktop pi@raspberrypi4:~ $ sed -i "${inset_line}d" /home/pi/vdesktop/vdesktop pi@raspberrypi4:~ $ sed -i "${inset_line2}d" /home/pi/vdesktop/vdesktop pi@raspberrypi4:~ $