Skip to content

How to create a DietPi image for Parallels Desktop (macOS)

Bastian Pätzold edited this page Jun 5, 2022 · 3 revisions

Prerequirement on your macOS system

Download base image

Create and prepare the VM from Parallels Desktop GUI

  1. Start the Installation Assistant of Parallels: E.g. press + in Parallels Control Center
  2. Choose Install Windows or another OS from a DVD or image file > Continue
  3. Choose the Debian base image (see above) > Continue
  4. Name: DietPi_Parallels-x86_64-Bullseye > check Customize settings before installation > Create
  5. In the machine configuration select tab Hardware
  6. CPU & Memory > Memory: 1024 (1 GB) > button Advanced > Hypervisor: Parallels > check Adaptive Hypervisor and Enable nested virtualization > OK
  7. Shared Printers > Deselect all printers
  8. Network > Source: Bridget Network: Default Adapter > button Advanced > button Open Network Preferences and deselect Enable IPv4 DHCP and Enable IPv6 DHCP (in Tabs IPv4 and IPv6) > go back and OK to acknowledge network settings
  9. Sound & Camera > Sound Output: Disable > Microphone: Disable > Camera: Deselect Share Mac camera with Linux
  10. Hard Disk> button Advanced > button Properties > set Size to 8 GB > button Apply
  11. Finish hardware configuration and Continue with image creation. Then the Debian netinst installer starts (“Debian GNU/Linux installer menu”)

Debian installer

  • NB: The following steps can be automated, however the effort on netinst installers is too high to have any benefit over manually going through the installation for a single VM: https://www.debian.org/releases/stable/amd64/apbs01.en.html#preseed-methods
  • Advanced options > Expert install
  • Choose language > English > United Kingdom > en_GB.UTF-8 > Continue (select NO additional locales)
  • Configure the keyboard > British English
  • Detect network hardware
  • Deselect any Modules to load as we don't require them.
  • Configure the network > Yes (auto-configure) > 3 seconds
  • Hostname: DietPi
  • Domain name: <leave empty>
  • APT mirror: Just use one near to your location or deb.debian.org. It will be overwritten anyway by DietPi-PREP, as actually most other settings as well 😉.
  • Download installer components: Deselect everything > Continue
  • Set up users > Enable shadow passwords? Yes > Allow root login? Yes > Root password: dietpi
  • Create a normal user account now? No
  • Configure the clock > Use NTP? Yes > leave default mirror 0.debian.pool.ntp.org > time zone: UTC
  • Detect disks > Deselect any Modules to load > Partition discs > Manual > Select SCSI (sda) ... (or similar) > Create new empty partition table? Yes > msdos > Select FREE SPACE > Create a new partition > New partition size: max > Primary
  • Verify: Ext4 and mount point / > Done setting up the partition > Finish partitioning > No return due to missing swap partition > Yes write to disk
  • Install the base system
  • Select kernel package: linux-image-amd64
  • Select targeted since no generic driver installation is required for virtual machines.
  • Configure the package manager > No nonfree, contrib and especially No source repository!
  • Select security updates and release updates and skip backported software for now, which will be re-added by DietPi-PREP later.
  • Select and install software > No automatic updates > No virtualbox-guest extension and No survey (user should decide this oneself later)
  • Deselect all additional software
  • Install the GRUB boot loader > Yes to master boot record > to the only available partition (/dev/sda) > Not to the EFI removable media path, actually no idea why it detects EFI, as it was not selected on machine and is definitely not available afterwards...
  • Finish the installation > set to UTC? Yes
  • BEFORE Continue: Unplug the optical drive (Player > Removable Devices > CD/DVD > Disconnect > override lock), to prevent reboot into installer > Continue

DietPi-PREP

  • Login as root:dietpi
  • apt update
  • apt install -y ca-certificates curl dropbear
  • Connect via SSH (IP: ip a) for easier copy&paste etc.
    bash -c "$(curl -sSfL 'https://raw.githubusercontent.com/MichaIng/DietPi/master/.build/images/dietpi-installer')"
  • Git branch: master
  • Enter your name to be shown as image creator within DietPi banner credits.
  • Enter Debian as this was our base image above.
  • Device: 20 : x86_64 Virtual Machine
  • Deselect WiFi functionality for VMs as they virtualise Ethernet adapters for network only.
  • Distro version: 6: Bullseye
  • shutdown now

Image export and packaging

  1. Open the macOS Finder and navigate to the home//Parallels directory. There the .pvm file of the VM should be located. Alternatively in the Parallels Control Center right click on the VM and select Show in Finder
  2. Right click on .pvm file > Show Package Contents > Several files should be occur within the .pvm
  3. Move to bin all .backup, .log files (via right click). E.g. config.pvs.backup, parallels.log, statistic.log
  4. Right click on .hdd file (DietPiParallels-x8664-Bullseye-0.hdd) > Show Package Contents. Move to bin the .cache and .Backup files
  5. Finish Finder. .pvm file is finished and ready for packing to .7z
  6. Pack to .7z only with README.md and not with hash.txt
    Remark: On Linux systems the .pvm file is a directory structure where the md1sum etc. commands cannot calculate the hash values for hash.txt.