User avatar
Botspot
Posts: 1237
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Vdesktop: Ever wanted to run an img file before flashing it to an SD card?

Sun Sep 15, 2019 1:02 pm

TL;DR I have made a script to run Raspbian, within Raspbian.

This script is excellent in these situations:
  • Migrating to a clean install of Raspbian and want to compare the appearance of both OS'es at once.
  • Running two versions of software at the same time, one in the host, other in the guest.
  • Running something you might want to undo (such as compiling) and don't want your main OS modified.
  • "Switch" OSes without ever shutting down or swapping SD cards.
  • Run Raspbian Stretch on a Pi 4.
Here's a screenshot of Vdesktop running Stretch inside Buster!
Image
BTW: I've made a GUI wrapper for Vdesktop called Pi-Power-Tools. It has many more Raspbian img-editing features, like shrink, expand, mount, edit partitions, etc.

To download:

Code: Select all

git clone https://github.com/Botspot/vdesktop
chmod +x /home/pi/vdesktop/vdesktop
On the first run Vdesktop will prompt you to install Xephyr, Systemd-nspawn, and Expect.

To download and run a fresh Stretch image:

Code: Select all

cd
git clone https://github.com/Botspot/vdesktop
chmod +x /home/pi/vdesktop/vdesktop
wget http://downloads.raspberrypi.org/raspbian_full/images/raspbian_full-2019-04-09/2019-04-08-raspbian-stretch-full.zip
unzip /home/pi/2019-04-08-raspbian-stretch-full.zip
sudo /home/pi/vdesktop/vdesktop /home/pi/2019-04-08-raspbian-stretch-full.img
Command usage:
Boot from an image file:

Code: Select all

sudo ~/vdesktop/vdesktop /home/pi/2019-04-08-raspbian-stretch-full.img
Or a block device:

Code: Select all

sudo ~/vdesktop/vdesktop /dev/sda
Or the root directory of the guest:

Code: Select all

sudo ~/vdesktop/vdesktop /home/pi/raspbian-stretch/
A second word specifies the boot mode: cli, cli-login, and gui. If none specified, cli mode is assumed.

Once the guest has booted, Expect will login to the Pi user automatically (if you chose cli-login or gui)
Then the guest's GUI will appear in a Xephyr window.

To do:
  • Write up a more comprehensive set of instructions, and add come CLI flags. Check! :D CLI flags choose what boot mode, and instructions are in the form of the Pi Power Tools GUI app.
  • autologin to the guest, so the user doesn't have to do it manually. Check!
  • auto-detect default desktop session profile to correctly boot pi-top OS and Raspbian that doesn't have raspberrypi-ui-mods installed. Low priority.
  • Sync sound between host and guest, preferably avoiding pulseaudio. I'm making progress in this!
  • Sync clipboards between host and guest.
  • display text at guest's default size instead of autoscaling to Xephyr's aspect ratio.
  • display guest's default mouse pointer instead of the fall-back Adwaita.
Last edited by Botspot on Mon May 11, 2020 1:03 pm, edited 13 times in total.
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

hippy
Posts: 7361
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Powerful Tool to run a Stretch Container in Buster. Testers wanted, comments wanted.

Sun Sep 15, 2019 3:10 pm

Excelent stuff. On my 3B (non-plus) I managed to get Buster running under Buster okay -

Code: Select all

pi@Pi3B:~ $ sudo /home/pi/vdesktop/vdesktop /home/pi/2019-06-20-raspbian-buster.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
... etc ...
But had problems trying to run other images which I have run before on a 3B ...

Code: Select all

pi@Pi3B:~ $ sudo /home/pi/vdesktop/vdesktop /home/pi/lineage-14.1-20180615-UNOFFICIAL-KonstaKANG-rpi3.img 
OK, looks like you specified an .img file.
/home/pi/vdesktop/vdesktop: line 134: 264192
2361344 * 512: syntax error in expression (error token is "2361344 * 512")
Unable to create loop device

Code: Select all

pi@Pi3B:~ $ sudo /home/pi/vdesktop/vdesktop /home/pi/chromiumos_image_r70.img 
OK, looks like you specified an .img file.
/home/pi/vdesktop/vdesktop: line 134: * 512: syntax error: operand expected (error token is "* 512")
Unable to create loop device
That may be as expected, not being Raspbian images and all, but it does seem to point to a "syntax error" in vdesktop.

User avatar
Botspot
Posts: 1237
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Powerful Tool to run a Stretch Container in Buster. Testers wanted, comments wanted.

Sun Sep 15, 2019 7:30 pm

hippy wrote:
Sun Sep 15, 2019 3:10 pm

Code: Select all

pi@Pi3B:~ $ sudo /home/pi/vdesktop/vdesktop /home/pi/chromiumos_image_r70.img 
OK, looks like you specified an .img file.
/home/pi/vdesktop/vdesktop: line 134: * 512: syntax error: operand expected (error token is "* 512")
Unable to create loop device
That may be as expected, not being Raspbian images and all, but it does seem to point to a "syntax error" in vdesktop.
Yes, vdesktop is only designed to boot Raspbian images at this time; the main reason for that being that the container is actually running the host's kernel. So images such as Chromium OS are not supported. Second reason is that the image mounting utility my script is using is only intended for Raspbian img files. So it has no clue what to do when faced with Chromium OS'es 15 partitions. Edit: So that's where the syntax error is coming from.
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

User avatar
Botspot
Posts: 1237
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Vdesktop: Ultimate Raspbian Virtual Machine Script. Feedback wanted!!

Wed Sep 25, 2019 3:23 pm

Good morning, everyone.

Well my Pi 4 finally arrived, and after some extensive testing in several configurations, I am relieved to announce that using vdesktop, Raspbian Stretch runs at 100% native speed on a Pi 4.

The vdesktop script has been updated a bit and a couple bugs worked out (see the github page for more details), so if anyone out there has suggestion or bug report, please let me know!

Also, I am working on a bootable image with vdesktop installed and a Raspbian Stretch demo image downloaded. So if anyone has any experience on the proper way to create a clean bootable image, please let me know!
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12986
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Vdesktop: Ultimate Raspbian Virtual Machine Script. Feedback wanted!!

Thu Sep 26, 2019 8:13 pm

Thread moved to general discussion, as requested by OP.

sunilvb
Posts: 5
Joined: Sun Feb 02, 2014 2:54 am

Re: Vdesktop: Ultimate Raspbian Virtual Machine Script. Feedback wanted!!

Fri Sep 27, 2019 11:00 pm

Was able to install and run Stretch on RPi 4!!

Observations :
[FAILED] Failed to start Remout Root and Kernel File System
[FAILED] Failed to start rng-tools.service
[FAILED] Failed to start Avahi mDNS/DNS-SD stack
[FAILED] FAiled to start LSB: Resize the root filesystem to fill partition

In spite of the FAILED msg, I was able to login and start the guest os (Stretch on Buster). Although, the task bar icons are invisible.
The browser does not connect to internet.
Questions:
How do I ssh into the guest from host or external computer on the network?
What options are available to communicate from host to guest?
How do I copy file from host to guest and vice versa?

User avatar
Botspot
Posts: 1237
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Vdesktop: Ultimate Raspbian Virtual Machine Script. Feedback wanted!!

Sat Sep 28, 2019 11:00 pm

sunilvb wrote:
Fri Sep 27, 2019 11:00 pm
[FAILED] Failed to start Remout Root and Kernel File System
[FAILED] Failed to start rng-tools.service
[FAILED] Failed to start Avahi mDNS/DNS-SD stack
[FAILED] FAiled to start LSB: Resize the root filesystem to fill partition
That is completely normal, and in fact part of the beauty of systemd-nspawn:
systemd-nspawn limits access to various kernel interfaces in the container to read-only, such as /sys, /proc/sys or /sys/fs/selinux. The host's network interfaces and the system clock may not be changed from within the container. Device nodes may not be created. The host system cannot be rebooted and kernel modules may not be loaded from within the container.
sunilvb wrote:
Fri Sep 27, 2019 11:00 pm
Although, the task bar icons are invisible.
Strange. It works for me every time. Well I lengthened the "grace period", it should work now.
sunilvb wrote:
Fri Sep 27, 2019 11:00 pm
The browser does not connect to internet.
I noticed that too. Only seems to be a problem on the Pi 4, not earlier models. I'll have to research it.
sunilvb wrote:
Fri Sep 27, 2019 11:00 pm
How do I ssh into the guest from host or external computer on the network?
Well from the host, that's easy. Just type commands into the same terminal you entered the guest's username and password.
From another computer on the local network, I have never tried this. But I think the guest would need internet connection, so once I get that working again it should work like it would on a normal Pi.
sunilvb wrote:
Fri Sep 27, 2019 11:00 pm
What options are available to communicate from host to guest?
Currently the Xephyr window only "listens" to the keyboard and mouse. So far I have had no luck getting the guest to be able to communicate with a usb device connected to the host machine.
sunilvb wrote:
Fri Sep 27, 2019 11:00 pm
How do I copy file from host to guest and vice versa?
Very easy. I forgot to mention this. Vdesktop mounts all img files to /mnt/virtualdesktop by default. So just go in there and you can access everything.
Edit: Vdesktop now mounts img files and block devices to /media/pi/vdesktop. That way, the desktop will show them as a mounted disk.
Last edited by Botspot on Mon Jan 13, 2020 3:44 pm, edited 1 time in total.
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

User avatar
Botspot
Posts: 1237
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Vdesktop: Ultimate Raspbian Virtual Machine Script. Feedback wanted!!

Mon Sep 30, 2019 1:59 am

Update: bootable image released. Download it here, and see the first post for details.
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

WoodyC
Posts: 4
Joined: Sun Jan 12, 2020 8:03 am

Re: Vdesktop: Ultimate Raspbian Virtual Machine Script. Feedback wanted!!

Sun Jan 12, 2020 8:10 am

Excellent works, thank you!

Now I can run Raspbian Stretch inside Raspbian Buster. But there is a little problem, the script did not work with image with 3 partitions. Partition details as below:

Code: Select all

Disk /dev/loop7: 29.9 GiB, 32111591424 bytes, 62717952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Device       Boot    Start      End  Sectors  Size Id Type
/dev/loop7p1          8192   532480   524289  256M  c W95 FAT32 (LBA)
/dev/loop7p2        540672 45139967 44599296 21.3G 83 Linux
/dev/loop7p3      45139968 62717951 17577984  8.4G 83 Linux
* p1 is boot, p2 is / and p3 is a data partition.

Error output as below.

Code: Select all

OK, looks like you specified an .img file.
./vdesktop: line 181: 540672
45139968 * 512: syntax error in expression (error token is "45139968 * 512")
Unable to create loop device
umount: /mnt/virtualdesktop/etc/rc.local: no mount point specified.
umount: /mnt/virtualdesktop/etc/profile: no mount point specified.
umount: /mnt/virtualdesktop: not mounted.
losetup: option requires an argument -- 'd'
Try 'losetup --help' for more information.

If I delete the last partition in the image, it run well.

User avatar
Botspot
Posts: 1237
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Vdesktop: Ultimate Raspbian Virtual Machine Script. Feedback wanted!!

Sun Jan 12, 2020 10:32 pm

I took the freedom to condense the quote below.
WoodyC wrote:
Sun Jan 12, 2020 8:10 am
the script did not work with image with 3 partitions.
If I delete the last partition in the image, it run well.
Good suggestion. It's fixed. Just re-run your script and it should auto-update with the new version.

What happened was I just borrowed most of RonR's image-mount bash script to mount image files. It works, but it's cumbersome:

Code: Select all

PART="Linux"
  MNT="$mntpnt"
  IMG="$1"
  if [ "${PART}" = "" ]; then
    PART="type=83"
  else
    PART="$(tr [A-Z] [a-z] <<< "${PART}")"
    if [ "${PART}" = "w95" ];then
      PART="type=c"
    elif [ "${PART}" = "linux" ];then
      PART="type=83"
    else
      usage
    fi
  fi
  
  INFO="$(sfdisk -d "${IMG}")"
  START=$(grep "${PART}" <<< "${INFO}" | sed -n 's|^.*start=\s\+\([0-9]\+\).*$|\1|p')
  SIZE=$(grep "${PART}" <<< "${INFO}" | sed -n 's|^.*size=\s\+\([0-9]\+\).*$|\1|p')
  LOOP="$(losetup -f --show -o $((${START} * 512)) --sizelimit $((${SIZE} * 512)) "${IMG}")"
  if [ $? -ne 0 ]; then
    echo "Unable to create loop device"
    exit 1
  fi
  if [ "${PART}" = "type=c" ]; then
    dosfsck "${LOOP}"
  else
    FS_TYPE=$(blkid "${LOOP}" | sed -n 's|^.*TYPE="\(\S\+\)".*|\1|p')
    if [ "${FS_TYPE}" = "f2fs" ]; then
      fsck.f2fs "${LOOP}"
    else
      fsck.ext4 -f "${LOOP}"
    fi
  fi
  if [ $? -ne 0 ]; then
    losetup -d "${LOOP}"
    echo "Filesystem appears corrupted"
    exit 1
  fi
  mount "${LOOP}" ${MNT}
  echo ""
  echo "${IMG} mounted on ${MNT}"
Yes, a lot longer than necessary. And only works if the img has 2 partitions.
So I re-wrote it:

Code: Select all

LOOP="$(losetup -fP --show $1)"
  echo "$LOOP"
  mount -o rw "${LOOP}p2" "$mntpnt"
  mount -o rw "${LOOP}p1" "${mntpnt}/boot"
A lot shorter, it works considerably faster, mounts boot properly, and won't freak out if there's a third partition. 8-)
Your problem should be solved.

Any more bug reports? Improvements or suggestions?
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

WoodyC
Posts: 4
Joined: Sun Jan 12, 2020 8:03 am

Re: Vdesktop: Ultimate Raspbian Virtual Machine Script. Feedback wanted!!

Mon Jan 13, 2020 2:26 pm

Thank you for the quick response and solution. It is now working fine with the image having three partitions. The new version also found to have added nice features, showing mounted volume on desktop and keep it mounting on guest close. It’s very convenient.

However, the auto update (at least on the old version) appear to have issue. It detect the new version but couldn't update it successfully. Output show as below.
================================================================
Vdesktop has a new version. Would you like to download it? [Y/n]
y
OK. Downloading Vdesktop.
New version has been downloaded. Vdesktop is exiting.
cp: target '.' is not a directory
================================================================
I've download the new version from GitHub instead.

Thank you!

User avatar
Botspot
Posts: 1237
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Vdesktop: Ultimate Raspbian Virtual Machine Script. Feedback wanted!!

Mon Jan 13, 2020 3:26 pm

WoodyC wrote:
Mon Jan 13, 2020 2:26 pm
It detect the new version but couldn't update it successfully. Output show as below.

Code: Select all

Vdesktop has a new version. Would you like to download it? [Y/n]
y
OK. Downloading Vdesktop.
New version has been downloaded. Vdesktop is exiting.
cp: target '.' is not a directory
It's always worked fine for me. I improved the update procedure, it should work better now.
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

WoodyC
Posts: 4
Joined: Sun Jan 12, 2020 8:03 am

Re: Vdesktop: Ever wanted to run an img file before flashing it to an SD card?

Tue Jan 14, 2020 1:34 pm

Good news is version 5 update code is working fine. But, I didn't realize it will erase everything in the ~/vdesktop folder in which I used to store image startup script. May be some warning message before the update is good.

User avatar
Botspot
Posts: 1237
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Vdesktop: Ever wanted to run an img file before flashing it to an SD card?

Tue Jan 14, 2020 3:00 pm

WoodyC wrote:
Tue Jan 14, 2020 1:34 pm
Good news is version 5 update code is working fine. But, I didn't realize it will erase everything in the ~/vdesktop folder in which I used to store image startup script. May be some warning message before the update is good.
Yes, Vdesktop now clears its folder before putting the new version in. This ensures that all the vdesktop users will have matching folders to prevent problems. Sorry it cleared your script. :oops:
Version 6 vdesktop moves the old version to ~/vdesktop.old instead of deleting it.
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools


User avatar
Botspot
Posts: 1237
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Vdesktop: Ever wanted to run an img file before flashing it to an SD card?

Tue Feb 04, 2020 9:48 pm

I've been looking for a way to do this for several months: bypass the guest login or at least accommodate for guests whose password is not raspberry. This is the only issue preventing a fully automated GUI tool from being released. Well I finally had a breakthrough solution: override the guest's password file. Vdesktop now mounts its own over top the guest's one temporarily.
Tl;DR In the past, you had to know the guest's password to login. Now, vdesktop ensures the password is always raspberry. When you reach the login screen, no matter what the guest's password actually is, type "raspberry" in the password box.
Edit: the expect command takes care of typing in the password for you.
Last edited by Botspot on Sun May 10, 2020 1:28 pm, edited 1 time in total.
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

masseter
Posts: 4
Joined: Thu Apr 09, 2020 6:44 am

Re: Vdesktop: Ever wanted to run an img file before flashing it to an SD card?

Sun May 10, 2020 10:36 am

Hi,

I tried this script with argument gui, but got this:

pi@pi4:~ $ sudo vdesktop/vdesktop 2018-03-13-raspbian-stretch.img gui
Message from Botspot: Questions or suggestions?
viewtopic.php?&t=251757
OK, looks like you specified a disk image.
/dev/loop0
Your cursor color will be blue until the container is terminated.
Booting in 5 seconds.
Booting in auto-login mode.


spawn systemd-nspawn --machine virtualdesktop -bD /media/pi/vdesktop --bind /lib
Spawning container virtualdesktop on /media/pi/vdesktop.
Press ^] three times within 1s to kill container.
/lib/systemd/systemd: error while loading shared libraries: libseccomp.so.2: cannot open shared object file: No such file or directory
Container virtualdesktop failed with error code 127.
send: spawn id exp4 not open
while executing
"send -- "pi\r""

The machine has exited, but you can still access the guest. Press Ctrl+C to unmount /media/pi/vdesktop
^C
Preparing to exit...
Unmounted and exiting...
_________________________________
pi@pi4:~ $ dpkg -l | grep libseccomp
ii libseccomp-dev:armhf 2.3.3-4 armhf high level interface to Linux seccomp filter (development files)
ii libseccomp2:armhf 2.3.3-4 armhf high level interface to Linux seccomp filter
__________________________________
pi@pi4:~ $ uname -a
Linux pi4 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l GNU/Linux
pi@pi4:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster


Any idea?

User avatar
Botspot
Posts: 1237
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Vdesktop: Ever wanted to run an img file before flashing it to an SD card?

Sun May 10, 2020 5:23 pm

masseter wrote:
Sun May 10, 2020 10:36 am
Hi,
I tried this script with argument gui, but got this:

Code: Select all

/lib/systemd/systemd: error while loading shared libraries: libseccomp.so.2: cannot open shared object file: No such file or directory
Any idea?
I was able to replicate this on a fresh 2018-03-13 Stretch img from the archives.
Upon some experimentation, I found that running vdesktop as cli (instead of gui) did work. But why? Well, looking at the respective systemd-nspawn commands showed the answer:
GUI version:

Code: Select all

systemd-nspawn --machine virtualdesktop -bD /media/pi/vdesktop --bind /lib
CLI version:

Code: Select all

systemd-nspawn --machine virtualdesktop -bD /media/pi/vdesktop
Now I forget why I put "--bind /lib" in one but not the other, but I've taken it out now. Run vdesktop again and allow it to update.
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

aerthqwtjh
Posts: 31
Joined: Mon Sep 10, 2018 5:22 pm

Re: Vdesktop: Ever wanted to run an img file before flashing it to an SD card?

Mon May 11, 2020 11:37 am

Hi there! :-)

There is NO file chmod +x /home/pi/vdesktop/rc.local ...

On my raspberry it's /root/TEMP/vdesktop/rc.local

So the rc.local file must be from GIT, right...?

So it seems, it doesnt exist...

???

Thx for feedback.
Regards, Jan

User avatar
Botspot
Posts: 1237
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Vdesktop: Ever wanted to run an img file before flashing it to an SD card?

Mon May 11, 2020 12:27 pm

aerthqwtjh wrote:
Mon May 11, 2020 11:37 am
There is NO file chmod +x /home/pi/vdesktop/rc.local ...

So the rc.local file must be from GIT, right...?

So it seems, it doesnt exist...
Sure enough. :oops: :roll: Vdesktop used to ship with a rc.local script that it would mount inside its imgs to display the user some instructions. That's no longer the case. Thank you! I'll update the instructions.
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

aerthqwtjh
Posts: 31
Joined: Mon Sep 10, 2018 5:22 pm

Re: Vdesktop: Ever wanted to run an img file before flashing it to an SD card?

Mon May 11, 2020 12:39 pm

Thank you very much!! :-)

And there seems to be another issue:
https://github.com/Botspot/vdesktop/issues/5

-> Is user `pi` hard-coded in your product? Seems so...(?)
Regards, Jan

User avatar
Botspot
Posts: 1237
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Vdesktop: Ever wanted to run an img file before flashing it to an SD card?

Mon May 11, 2020 12:44 pm

aerthqwtjh wrote:
Mon May 11, 2020 12:39 pm
-> Is user `pi` hard-coded in your product? Seems so...(?)
Yes, but as minimally as possible. By default, vdesktop tries to mount its imgs to /media/pi/vdesktop. See my answer in that github issue.
Last edited by Botspot on Mon May 11, 2020 2:29 pm, edited 1 time in total.
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

aerthqwtjh
Posts: 31
Joined: Mon Sep 10, 2018 5:22 pm

Re: Vdesktop: Ever wanted to run an img file before flashing it to an SD card?

Mon May 11, 2020 1:06 pm

Thx, i can confirm that it works! :-)
Regards, Jan

techcom
Posts: 6
Joined: Thu Apr 20, 2017 5:40 am

Re: Vdesktop: Ever wanted to run an img file before flashing it to an SD card?

Thu May 21, 2020 6:22 pm

@Botspot
First of all many many thanks for this script.
It is working perfect and looks like saving my life.

As i am running a music server in stretch (which is not working
for now in buster) do you know how can i pipe the output of the
guest system to the host's audio jack?

thx in advance

User avatar
Botspot
Posts: 1237
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas
Contact: Website

Re: Vdesktop: Ever wanted to run an img file before flashing it to an SD card?

Thu May 21, 2020 11:40 pm

techcom wrote:
Thu May 21, 2020 6:22 pm
As i am running a music server in stretch (which is not working
for now in buster) do you know how can i pipe the output of the
guest system to the host's audio jack?
I've been working on this for some time now.
My solution involves bind-mounting the alsa usb devices directly to the guest.
In the meantime, I suggest you try sakaki's method, pulseaudio, to sync sound from guest to host. This approach is vastly inferior, but it'll work in your case.
See this site that explains how to configure pulseaudio for systemd-nspawn.
For this approach, you need to install pulseaudio on both the host and the guest. (I think, maybe you can skip that step in the guest, but not sure)
Like this:

Code: Select all

sudo apt install -y pulseaudio
And then you'd put your bind mount in line 297 of the main vdesktop script.
Now I haven't tried this yet, so if you have problems, ask me.
Want to make your own Raspbian image?
  • Hard way: Mess with confusing terminal commands.
  • Easy way: Let Pi-Power-Tools do it all for you!
Boot your image in a VM, Flash from the Internet at top speed, Mount (to drop files in), Edit partitions, Shrink/Expand, Repair, and more. Enjoy! :)
https://github.com/Botspot/Pi-Power-Tools

Return to “General discussion”