Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General | Update VM images to Stretch #1219

Closed
Fourdee opened this issue Oct 30, 2017 · 14 comments
Closed

General | Update VM images to Stretch #1219

Fourdee opened this issue Oct 30, 2017 · 14 comments

Comments

@Fourdee
Copy link
Collaborator

Fourdee commented Oct 30, 2017

  • 🈯️ VMware
  • 🈯️ VirtualBox Many thanks @MichaIng !
@MichaIng
Copy link
Owner

Manual upgrading VirtualBox image to Stretch worked without any error by the way.

At least for testing purpose a QEMU image would be nice as well, as it provides "real" emulation of ARM processors and even natively provides a RPi2 machine. I tried to get the RPi2 DietPi image running on it, but it starts with boot loops (same as the default Raspbian Lite image). Something needs to be adjusted with the SD partitions, then it works, but the DietPi first start scripts break it again.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Nov 25, 2017

@MichaIng
Copy link
Owner

MichaIng commented Nov 27, 2017

@Fourdee
I could help to build the VirtualBox image. How do you start? Using the official Debian CD image and manually go through system preparation and finalize scripts?
https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/

Also if I see the preparation script: Couldn't this be automated also by defining some hardware+distro variables at the top and run the ??? parts accordingly? Or is there some other reason you run the commands manually, better control/validation possibilities, or other issues?

@Fourdee
Copy link
Collaborator Author

Fourdee commented Nov 27, 2017

@MichaIng

Or is there some other reason you run the commands manually, better control/validation possibilities

Exactly this. If we did automate it, we'd need to check each command output for errors.

I've considered automating the installing as you mentioned with HW_MODEL etc, but we'd need to improve fstab generation in both prep and finalize scripts, that populates current mounts, then puts in our additional entries.
Possibly a few more things that put me off automating this, however, cant remember at the moment 😄

I could help to build the VirtualBox image. How do you start? Using the official Debian CD image and manually go through system preparation and finalize scripts?
https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/

By all means go for it 👍

  • Debian 9 net install iso
  • 8-20GB VM disk, expanding (not preallocated/fixed size)
  • 1 partition (EXT4), no swap
  • when prompted to install software (eg: desktop/ssh/tools), make sure all are unselected
  • Once its ready, start system prep.

Although, it may be easier to simply convert the VMware disk to VirtualBox? 😄

@MichaIng
Copy link
Owner

MichaIng commented Nov 27, 2017

@Fourdee
Okay, will do. Another question: Is there a reason why some packges are purged first and reinstalled afterwards, e.g. clean config files or something?
I want to use the chance to do another image afterwards, testing things mentioned here: https://github.com/Fourdee/DietPi/issues/1146
for comparison and testing.

Although, it may be easier to simply convert the VMware disk to VirtualBox? 😄

No idea, is the setup/hardware-imulation related stuff the same between VMware and VirtualBox? Did you try this in the past? Would be another thing to test and compare otherwise 😄.

@k-plan
Copy link
Contributor

k-plan commented Nov 27, 2017

@MichaIng
By all means go for it 👍

Yes, please.

@Fourdee
Okay, will do.

Thank you very much.

Did you try this in the past?

Some user fiddling around with image converting virtual disk here: https://github.com/Fourdee/DietPi/issues/804

http://www.sytone.com/2017/07/getting-a-dietpi-image-running-on-hyper-v/

They used qemu-img for Windows.

But never test it.

@MichaIng
Copy link
Owner

MichaIng commented Nov 28, 2017

Some user fiddling around with image converting virtual disk here

Interesting. Could save time of course, on the other hand we do not create images thaat often 😉. But I am still thinking if the emulated hardware and thus dietpi steps are the same. On the other hand, all the config adjustment is anyway done on first run setup. If I find the time, I will create the image both ways and compare them.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Nov 28, 2017

@MichaIng

Another question: Is there a reason why some packges are purged first and reinstalled afterwards, e.g. clean config files or something?

I was going to say "I forgot to remove them from removal" however,:

  • Purging clears all configuration files, ensures we get clean configs to work with once reinstalled.

So no loss and maybe some gain 😄

@MichaIng
Copy link
Owner

MichaIng commented Nov 29, 2017

@Fourdee
Hehe learning by doing: Some questions/remarks about installation:

Debian first run asks quite a lot of questions:

  • All localize things (language, keyboard, WLAN,...) set to GB / en_GB.UTF_8
  • Domain name? Should not matter yet, right? Just chose localhost.
  • Enabled shadow passwords, seems good.
  • Just kept root user with password "dietpi".
  • Single partition with expending size up to 12 GB (Jessie image was 8, but Stretch simply takes more space by default), it is quite challenging to get around the installer automatically creating swap partition^^. What to choose on creating new partition table? Don't find ext4 there. I used guided partitioning, removed both partitions afterwards (including swap) and creating a single new one in whole free space.
  • Chose firmware-linux-amd64 kernel, which will be updated to current version via apt.
  • No additional tools, no virtualbox guest extension and no generic firmware installation also? I also skipped the USB firmware installation, as the installer finds the in VirtualBox preconfigured virtual USB hub. Deactivated this also now by switching virtual pointer to PS/2, which is anyway not used in console.
  • There was a question about efi boot loader and to move it to some removable media part or something in case of buggy images. I just skipped that, bootup afterwards worked fine.

Now to the preparation script:

  • How do you practically go through the commands? As VirtualBox does not support copy&paste on console, I first installed dropbear and used ssh for copy&paste.
    €: Just found the optional openssh installation. Changed this to dropbear in new PR, as this anyway will be installed later, or was there a special reason for openssh?

  • By default apt tries to access to IPv6, for my system I needed to add Acquire::ForceIPv4 "true"; to apt settings. Will remove before image creation. But as IPv4 works on every system, we could use this as default and let users choose explicitly to enable/force IPv6? Same for wget on some servers, but this scripts here worked fine.

  • On purging/installing the packages I got:

    dropbear: WARNING: Invalid authorized_keys file, remote unlocking of cryptroot via SSH won't work!

    I guess I can ignore, since I don't use key authentication here?

  • In between I am asked to choose if/which keymaps to install, I choose to not touch it/leaf it as is.

  • echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile should be btw after package installation, as installation of swapfile asks again to overwrite that config.

  • Chose MBR: grub2 asks where to install to, I chose just the whole disk (sda) instead if the partition (sda1).

  • WLAN Firmware is not necessary? I installed it now, maybe someone wants to use WLAN USB stick for some reason?

  • /boot/dietpi/dietpi-logclear: line 243: /DietPi/dietpi/func/dietpi-notify: No such file or directory
    Info:

    • Log file directory | /var/log
    • Processed files | 22
    • Excluded files | 0
    • Cleared log files | 0
    • Unsupported files | 0
    • Deleted files | 22
    • Space cleared | 15213 KB

    We could symlink /DietPi/dietpi to /boot/dietpi first? But as it's just the notification...

root@dietpi:~# mount -a
mount: special device /dev/mmcblk0p1 does not exist

fstab expects sd card, thus manual adjustment of fstab necessary.

  • Copy&Paste cats does not fill empty lines. Have to take care about this, but think I added all empty lines manually.
    €: Copying from edit file page includes spaces!
  • My ethernet interface up by start was called enp0s3, thus /DietPi/dietpi/func/obtain_network_details didn't work and I needed to follow https://kernelpanik.net/rename-a-linux-network-interface-without-udev/ to rename it to eth0.

During finalize script somehow my internet connection broke. So wget could not download something. Needed to adjust interfaces for my environment and somehow needed to set eth0 to auto (instead of allow-hotplug) before it worked.

I didn't add much meta data to the appliance: http://dietpi.com + v158.

Finally I ended up with bootloops. First I thought it is because I forget to add a boot.ini. Chose the one from Odroid C1, which I also found on my Jessie VM image. But afterwards same result:
Log shows:

Failed to start Remount Root and Kernel File Systems
See systemctl status systemd-remount-fs.service for details.
...
Failed to start Create Volatile Files and Directories.
See systemctl status systemd-tmpdiles-setup.service for details
...
[Failed] RootFS is currently set to R/0.
...

Finally I resolved it by opening the image in another VM, find the UUID by ls -l /dev/disk/by-uuid and added it to boot.ini and fstab. Interesting is that UUID in fstab and boot.ini of the old Jessie VM does not match. Seems the one from fstab is actually not used?

I sent you the link to the image. Somehow it got >400 MB, no idea why. Will check again tomorrow and also do another, where all packages but the wanted ones are marked as auto installed (instead of purging the selection) and autoremove will do the rest. Just to compare.

@MichaIng
Copy link
Owner

MichaIng commented Nov 29, 2017

Okay, leaned some things:

  • x86 does not use /boot/config.txt nor boot.ini nor cmdline.ini
  • To boot up correctly one just need to change /etc/fstab to correct UUID. Perhaps it would be easier to just replace this with /dev/sda1 for VM images.
  • Before running finalise, I need to change (after interface name change to eth0) eth0 interface to auto. As allow-hotplug one of the earlier commands in finalise script breaks connection and wget commands afterwards fail. interfaces file will be reset during finalise anyway.
  • I created a new image now. Seems that every access to disk via other VM increases image size and it can't be reduced anymore to initial size by running finalise script afterwards.
  • I left firmware-linux-nonfree and wifi firmware packages away now. Hardly anyone will use wifi nor will simulate any special hardware through VirtualBox. Otherwise firmware can be installed easily.
  • I know there is some setting in dietpi.txt, but I would force apt IPv4 by default: Acquire::ForceIPv4 "true"; Every system will work with this and e.g. we could also disable IPv6 by default and by enabling it (if someone knows he uses IPv6 and configures his subnet accordingly) also force IPv4 can be removed again. I would do the same for curl and wget, but I didn't found a way to force it there. Adding -4 as option to curl/wget works, perhaps we can create some hook command and remove that again after ipv6 is enabled again?
    €: Add, for wget it's echo "prefer-family = IPv4" >> /etc/wgetrc

New image uploaded to link in email. No idea how to make it smaller than 310M, wonder how the VMware Stretch image can be that much smaller 🤔.

Fourdee referenced this issue Nov 30, 2017
+ DietPi-Config | WiFi: Now uses the wpa_supplicant.conf method to setup
WiFi connections. WEP is no longer supported by DietPi in this mode.
WPA-PSK/WPA2-PSK and OPEN hosts supported:
https://github.com/Fourdee/DietPi/issues/1262

+ DietPi-Config | RPi Stretch: Resolved an issue with onboard Wifi
failing to scan: https://github.com/Fourdee/DietPi/issues/1262

+ VMWare | Updated to Debian Stretch:
https://github.com/Fourdee/DietPi/issues/1219
@Fourdee
Copy link
Collaborator Author

Fourdee commented Dec 5, 2017

@MichaIng

New image uploaded to link in email. No idea how to make it smaller than 310M, wonder how the VMware Stretch image can be that much smaller

After finalize:
I boot into a Linux env (eg: Hirens boot cd), then zerofree the disk, sets all free space to 0, resulting in much smaller compressed file.
zerofree -v /dev/sda1

http://www.hirensbootcd.org/download/

@MichaIng
Copy link
Owner

MichaIng commented Dec 5, 2017

Used just another VirtualBox instance to manipulate the image.
Worked like a charm! New archive uploading, 180M instead of 318M 😃.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Dec 9, 2017

@MichaIng

Just tried the VirtualBox image you created, works a charm, great work and many thanks 👍

All uploaded and switched in http://dietpi.com

Fourdee referenced this issue Dec 9, 2017
+ VirtualBox | Updated to Debian Stretch, many thanks @MichaIng:
https://github.com/Fourdee/DietPi/issues/1219
@Fourdee
Copy link
Collaborator Author

Fourdee commented Dec 9, 2017

Completed, thanks again @MichaIng for creating the VirtualBox image 👍

@Fourdee Fourdee closed this as completed Dec 9, 2017
@Fourdee Fourdee mentioned this issue Dec 10, 2017
Fourdee referenced this issue Dec 10, 2017
**v159**
(10/11/17)

**Image Modifications:**

VMWare | Updated to Debian Stretch: https://github.com/Fourdee/DietPi/issues/1219

VirtualBox | Updated to Debian Stretch, many thanks @MichaIng: https://github.com/Fourdee/DietPi/issues/1219

RPi | Updated to Debian Stretch: https://github.com/Fourdee/DietPi/issues/475

**Changes / Improvements / Optimizations:**

General | Odroid XU3/4 images updated: Includes kernel support for EMMC 5.1 (thanks Meveric): https://github.com/Fourdee/DietPi/issues/1252

General | DietPi RPi kernel: Updated to 4.9.62.

General | DietPi RPi kernel: Will no longer re-install, if the current version is already at latest.

General | Added farenheit readouts for cpu_info and dietpi-config. For those "over the pond" :D : http://dietpi.com/phpbb/viewtopic.php?f=12&t=2516&p=9772#p9772

General | Sparky SBC: Kernel update to add support for USB 1.1 DACs, thanks @sudeep. This must be enabled manually, if using a USB 1.1 DAC, as this breaks Allo WiFi dongle. Edit "/DietPi/uEnv.txt" and change the value "aotg.aotg1_speed=1" (from "0"), then reboot.
General | We now define a default LD_LIBRARY_PATH for all systems, exported from /etc/bash.bashrc: https://github.com/Fourdee/DietPi/issues/475#issuecomment-350380744

DietPi-Services | Run "dietpi-services help" to see a full list of updated commands: Added support for "enable" and "disable". "disable" will stop and disable the service and prevent it from running, "enable" will enable and start the service. EG: "dietpi-services disable cron", will prevent Cron from starting. Added support for start/stop/restart a single service (eg: dietpi-services stop apache2). This is basically a symlink to systemD: https://github.com/Fourdee/DietPi/issues/1114

DietPi-Config | WiFi: Now uses the wpa_supplicant.conf method to setup WiFi connections. WEP is no longer supported by DietPi in this mode. WPA-PSK/WPA2-PSK and OPEN hosts supported: https://github.com/Fourdee/DietPi/issues/1262

DietPi-Backup | "Full Backup" Mode is now the default for fresh DietPi installations. This is mainly due to MySQL data now being in the DietPi userdata directory.

DietPi-Config | Tools > Benchmarks: Added ability to benchmark CPU performance based on bash + integer: https://github.com/Fourdee/DietPi/issues/1253#issuecomment-346881878

DietPi-Config | Time sync modes: NTP is now uninstalled when SystemD timedatectl is enabled. Reinstalled on demand. Timedatectl pool servers are now also set: https://github.com/Fourdee/DietPi/issues/1208#issuecomment-343762480

DietPi-Software | First run setup, now logged to /etc/dietpi/logs/dietpi-firstrun-setup.log.

DietPi-Software | APT log: Moved to /etc/dietpi/logs/dietpi-software_apt.log, to prevent RAMlog clearing log during automated installations.

DietPi-Software | MPD (Stretch): Install updated to 0.20.11. Also supports native DSD playback (thanks to @sudeep and PJotr), when "Native" output freq/bit is set: https://github.com/Fourdee/DietPi/issues/1236

DietPi-Software | moOde: MPD now installed via pre-built binaries. Will reduce install time: https://github.com/Fourdee/DietPi/issues/1223#issuecomment-345265290

DietPi-Software | Nextcloud: Correct database access issue for MariaDB + minor fixes: https://github.com/Fourdee/DietPi/pull/1242

DietPi-Software | ownCloud: Installation fixed, respecting different distro repos: https://github.com/Fourdee/DietPi/pull/1243

DietPi-Software | MPD (inc YMPD/O!MPD): Default data directory is now "/mnt", this will include all USB drives and network locations: https://github.com/Fourdee/DietPi/issues/1202

DietPi-Software | Mopidy: Default data directory is now "/mnt", this will include all USB drives and network locations.

DietPi-Software | Syncthing: Installation updated to version 0.14.40, for new installations only. Removal of inotify (now included in main syncthing): https://github.com/Fourdee/DietPi/issues/1260

DietPi-Software | Node-Red: Symlink created during install from ~/.node-red to DietPi user data dir: https://github.com/Fourdee/DietPi/issues/1256

DietPi-Software | YMPD: Fixed Stretch installation + Now available for all CPU archs + Upgraded to SystemD service: https://github.com/Fourdee/DietPi/issues/475

DietPi-Software | Gitea: Install updated to 1.3.1 (for new installations only). Added support for ARMv8. Now installed to /mnt/dietpi_userdata/gitea, runs as dietpi user: https://github.com/Fourdee/DietPi/issues/686 http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9863#p9863

**Bug Fixes:**

DietPi-Automation | Resolved an issue where SSH server choice, was not installing selected choice: https://github.com/Fourdee/DietPi/issues/1122

DietPi-Config | Nvidia driver: nouveau now disabled by default on x86_64, fix for 750Ti and possibily other Nvidia chipsets (thanks dubyazero): https://github.com/Fourdee/DietPi/issues/1244

DietPi-Config | RPi Stretch: Resolved an issue with onboard Wifi failing to scan: https://github.com/Fourdee/DietPi/issues/1262

DietPi-Config | RAM Benchmark: Resolved an issue where devices without /tmp mounted to tmpfs would fail the test. We now check for this mount, prior to allowing the test to run: https://github.com/Fourdee/DietPi/issues/1130#issuecomment-350114298

DietPi-Software | Pi-Hole: Resolved various issues with this installation. DietPi will now also detect a failed Pi-Hole script exit and flag as not installed. : https://github.com/Fourdee/DietPi/issues/1282#issuecomment-350490524

DietPi-Software | Redis: Minor un/installation/activation fixes of PHP module (Thanks to @MichaIng) : https://github.com/Fourdee/DietPi/pull/1249

DietPi-Software | moOde: Resolved an issue where dietpi-drive_manager mounted drives, would not be available in the libary: https://github.com/Fourdee/DietPi/issues/1223#issuecomment-346708298

DietPi-Software | PHP: Solve 'upload_tmp_dir' issue, if PHP service uses 'PrivateTmp': https://github.com/Fourdee/DietPi/issues/1144

DietPi-Software | Syncthing: Resolved a permissions issue with self program updates: https://github.com/Fourdee/DietPi/issues/1260

DietPi-Software | Home Assistant: Resolved an issue with ARMv8 installation, where Python build would fail due to lack of build-essential: https://github.com/Fourdee/DietPi/issues/1255

DietPi-Software | MPD: Corrected various uninstallation issues.

DietPi-Software | APT Removal: Resolved an issue in Stretch, where held packages were not being removed: https://github.com/Fourdee/DietPi/issues/475

DietPi-Software | FFMPEG: Resolved inability to install on XU4 Jessie: https://github.com/Fourdee/DietPi/issues/1273

DietPi-Software | Chromium (RPi Stretch): Resolved installation + desktop icon symlink: https://github.com/Fourdee/DietPi/issues/475#issuecomment-350111359

DietPi-Software | Resolved an issue where dietpi permissions were not being set correctly, for symlinked userdata dir.

DietPi-Update | Resolved an issue where .update_available file would still exist in no network situations: https://github.com/Fourdee/DietPi/issues/1258

Patch_File | Auto swapfile generation no longer run twice (mostly for pre v150 images): https://github.com/Fourdee/DietPi/issues/1257

**Allo Web Interface v4:**

MPD: Native DSD playback support, when "Native" output freq/bit is set in MPD settings page: https://github.com/Fourdee/DietPi/issues/1241

MPD: Default data directory is now "/mnt", this will include all USB drives and network locations.

SQUEEZELITE: Added ability to set native DSD output modes. Please note, success of selected output mode is limited to DAC and kernel capabilities. We have verified Combo 384 with u32le output mode on Sparky SBC + USB Bridge: https://github.com/Fourdee/DietPi/issues/1237#issuecomment-348241209

O!MPD: Updated to 1.03. Please make sure to update your library (Settings > Update), to rescan the new "/mnt" location which includes all networked and USB drives. Depending on your additional storage setup, the rescan may take 5-30 minutes.

RPi Image: Has been updated to Debian Stretch. This offers peformance improvements in the web interface, and newer ALSA libs. Previous installations are still supported. To upgrade, please write the new image. Upgrading to Stretch is not a requirement: http://dietpi.com/phpbb/viewtopic.php?f=8&t=2317&p=8869#p8869

Sparky SBC: We have remove the WiFi Hotspot installation by default, this is to avoid majority users having to remove this software title, before WiFi can be configured via terminal access. To reinstall this software, please connect the WiFi dongle, then run "dietpi-software install 60" via terminal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants