sudo apt install \ debootstrap \ squashfs-tools \ xorriso \ isolinux \ syslinux-efi \ grub-pc-bin \ grub-efi-amd64-bin \ mtools mkdir -p $HOME/LIVE_BOOT sudo debootstrap \ --arch=amd64 \ --variant=minbase \ buster \ $HOME/LIVE_BOOT/chroot \ http://ftp.de.debian.org/debian/ sudo chroot $HOME/LIVE_BOOT/chroot echo "DESKTOP-`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 9 | head -n 1`" > /etc/hostname echo "nameserver 8.8.8.8" > /etc/resolv.conf sudo apt-get install software-properties-common dirmngr echo "deb http://ftp.debian.org/debian stretch-backports main" >> /etc/apt/sources.list apt-get update apt install -y --no-install-recommends \ linux-image-amd64 live-boot systemd-sysv \ wireless-tools wpagui iputils-ping dnsutils lsof isc-dhcp-client dhcpcd5 iproute2 net-tools apt install -y --no-install-recommends \ virt-viewer spice-client-gtk remmina remmina-plugin-rdp remmina-plugin-secret remmina-plugin-spice apt install -y --no-install-recommends \ blackbox blackbox-themes xserver-xorg-core xserver-xorg xinit x11-xserver-utils apt install -y --no-install-recommends \ fluxbox dunst suckless-tools compton hsetroot xsettingsd lxappearance scrot apt install -y --no-install-recommends \ alsa-oss alsa-utils pulseaudio apt install -y --no-install-recommends \ nano lxterminal mlocate at-spi2-core locales firefox-esr localepurge apt clean systemctl enable systemd-networkd.service systemctl enable systemd-resolved.service cat <<'EOF' >>/etc/locale.gen de_DE.UTF-8 UTF-8 de_DE ISO-8859-1 de_DE@euro ISO-8859-15 EOF locale-gen dpkg-reconfigure localepurge passwd root adduser username mkdir /etc/systemd/system/getty@tty1.service.d/ cat <<'EOF' >/etc/systemd/system/getty@tty1.service.d/override.conf [Service] Type=simple ExecStart= ExecStart=-/sbin/agetty --autologin username --noclear %I 38400 linux EOF login username cat <<'EOF' >>/home/username/.profile #Startx Automatically if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then startx logout fi EOF mkdir .blackbox cat <<'EOF' >/home/username/.blackboxrc session.styleFile: /usr/share/blackbox/styles/Gray session.menuFile: /home/username/.blackbox/menu session.screen0.slit.placement: CenterRight session.screen0.slit.direction: Vertical session.screen0.slit.onTop: False session.screen0.slit.autoHide: False session.screen0.toolbar.onTop: False session.screen0.toolbar.autoHide: False session.screen0.toolbar.placement: BottomCenter session.screen0.toolbar.widthPercent: 66 session.screen0.enableToolbar: False session.screen0.workspaces: 1 session.screen0.workspaceNames: Workspace 1 session.screen0.strftimeFormat: %I:%M %p session.windowSnapThreshold: 0 session.autoRaiseDelay: 400 session.placementIgnoresShaded: True session.focusLastWindow: True session.opaqueMove: True session.changeWorkspaceWithMouseWheel: True session.imageDither: OrderedDither session.windowPlacement: RowSmartPlacement session.shadeWindowWithMouseWheel: True session.opaqueResize: True session.toolbarActionsWithMouseWheel: True session.rowPlacementDirection: LeftToRight session.maximumColors: 0 session.disableBindingsWithScrollLock: False session.fullMaximization: False session.colPlacementDirection: TopToBottom session.doubleClickInterval: 250 session.edgeSnapThreshold: 0 session.focusNewWindows: True session.focusModel: ClickToFocus EOF mkdir /home/username/.local mkdir /home/username/.local/share/ mkdir /home/username/.local/share/remmina/ cat <<'EOF' >/home/username/.local/share/remmina/desktop-pc_rdp_desktop-1_192-168-0-32.remmina [remmina] password= gateway_username= ssh_tunnel_loopback=0 serialname= printer_overrides= name=Desktop1 console=0 colordepth=64 security= precommand= disable_fastpath=0 postcommand= group=Desktop-PC server=192.168.0.32 glyph-cache=0 ssh_tunnel_enabled=0 disableclipboard=0 parallelpath= cert_ignore=0 serialpermissive=0 gateway_server= protocol=RDP ssh_tunnel_password= old-license=0 resolution_mode=1 disableautoreconnect=0 loadbalanceinfo= clientbuild= clientname= resolution_width=0 relax-order-checks=0 username= gateway_domain= serialdriver= domain=WORKGROUP gateway_password= smartcardname= exec= serialpath= enable-autostart=0 shareprinter=0 shareparallel=0 ssh_tunnel_passphrase= quality=9 disablepasswordstoring=0 parallelname= viewmode=4 ssh_tunnel_auth=2 shareserial=0 sharefolder= sharesmartcard=0 ssh_tunnel_username= execpath= resolution_height=0 useproxyenv=0 microphone=0 keyboard_grab=1 gwtransp=http window_maximize=1 ssh_tunnel_server= ignore-tls-errors=1 ssh_tunnel_privatekey= gateway_usage=0 sound=local,44100,2 EOF mkdir /home/username/.config/ mkdir /home/username/.config/remmina cat <<'EOF' >/home/username/.config/remmina/remmina.pref [remmina_pref] secret=UvK1Iwto/AOF6bGMXGFt14rPWkIYIB0ofplzxSXu1ng= datadir_path= remmina_file_name=%G_%P_%N_%h screenshot_path=/home/echoslider deny_screenshot_clipboard=true save_view_mode=true use_master_password=false unlock_timeout=0 unlock_password= floating_toolbar_placement=0 toolbar_placement=3 prevent_snap_welcome_message=false last_quickconnect_protocol=RDP fullscreen_on_auto=true always_show_tab=false hide_connection_toolbar=true hide_searchbar=true default_action=0 scale_quality=1 ssh_loglevel=1 ssh_parseconfig=true hide_toolbar=false small_toolbutton=false view_file_mode=0 resolutions=640x480,800x600,1024x768,1152x864,1280x960,1400x1050,1366x768 keystrokes=Send hello world§hello world\\n main_width=600 main_height=400 main_maximize=false main_sort_column_id=1 main_sort_order=0 expanded_group= toolbar_pin_down=false sshtunnel_port=4732 ssh_tcp_keepidle=20 ssh_tcp_keepintvl=10 ssh_tcp_keepcnt=3 ssh_tcp_usrtimeout=60000 applet_new_ontop=false applet_hide_count=false applet_enable_avahi=false disable_tray_icon=false dark_tray_icon=false recent_maximum=10 default_mode=3 tab_mode=0 fullscreen_toolbar_visibility=2 auto_scroll_step=10 hostkey=65508 shortcutkey_fullscreen=102 shortcutkey_autofit=49 shortcutkey_nexttab=65363 shortcutkey_prevtab=65361 shortcutkey_scale=115 shortcutkey_grab=65508 shortcutkey_viewonly=109 shortcutkey_screenshot=65481 shortcutkey_minimize=65478 shortcutkey_disconnect=65473 shortcutkey_toolbar=116 vte_font=Monospace 12 vte_allow_bold_text=true vte_lines=512 recent_RDP= rdp_use_client_keymap=0 rdp_quality_0=6F rdp_quality_1=7 rdp_quality_2=1 rdp_quality_9=80 rdp_deviceScaleFactor=0 rdp_desktopScaleFactor=0 rdp_desktopOrientation=0 [ssh_colors] background=rgb(213,204,186) cursor=rgb(69,55,60) foreground=rgb(69,55,60) color0=rgb(32,17,27) color1=rgb(190,16,14) color2=rgb(133,129,98) color3=rgb(234,165,73) color4=rgb(66,106,121) color5=rgb(151,82,44) color6=rgb(152,154,156) color7=rgb(150,140,131) color8=rgb(94,82,82) color9=rgb(190,16,14) color10=rgb(133,129,98) color11=rgb(234,165,73) color12=rgb(66,106,121) color13=rgb(151,82,44) color14=rgb(152,154,156) color15=rgb(213,204,186) [usage_stats] periodic_usage_stats_permitted=false periodic_usage_stats_last_sent=0 periodic_usage_stats_uuid_prefix= [remmina_news] periodic_rmnews_last_get=1608065525 periodic_rmnews_get_count=2 periodic_rmnews_uuid_prefix=CXM6TNMPEZ935B [remmina] name= ignore-tls-errors=1 EOF cat <<'EOF' >/home/username/.blackbox/menu [begin] () [exec] (Remote Access RDP) {remmina -c /home/username/.local/share/remmina/desktop-pc_rdp_desktop-1_192-168-0-32.remmina} [exec] (Remote Access SPICE) {remote-viewer -f spice://192.168.0.10:5900} [nop] () [submenu] (Tools) [exec] (RDP Manager) {remmina} [exec] (SPICE Manager) {remote-viewer} [exec] (Browser) {firefox} [exec] (Terminal) {lxterminal} [end] [nop] () [exec] (Neustarten) {systemctl reboot} [exec] (Beenden) {systemctl poweroff} [end] EOF history -c exit update-alternatives --install /usr/bin/x-session-manager x-session-manager /usr/bin/blackbox 40 cat <<'EOF' >/etc/systemd/system/rc-local.service [Unit] Description=/etc/rc.local Compatibility ConditionPathExists=/etc/rc.local [Service] Type=forking ExecStart=/etc/rc.local start TimeoutSec=0 StandardOutput=tty RemainAfterExit=yes SysVStartPriority=99 [Install] WantedBy=multi-user.target EOF cat <<'EOF' >/etc/rc.local #!/bin/bash ifconfig -a /usr/sbin/dhclient xrandr --auto exit 0 EOF chmod +x /etc/rc.local systemctl enable rc-local history -c exit sudo rm -dR $HOME/LIVE_BOOT/staging sudo rm -dR $HOME/LIVE_BOOT/tmp sudo rm -dR $HOME/LIVE_BOOT/debian-custom.iso mkdir -p $HOME/LIVE_BOOT/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp} sudo mksquashfs \ $HOME/LIVE_BOOT/chroot \ $HOME/LIVE_BOOT/staging/live/filesystem.squashfs \ -e boot sudo cp $HOME/LIVE_BOOT/chroot/boot/vmlinuz-* \ $HOME/LIVE_BOOT/staging/live/vmlinuz && \ sudo cp $HOME/LIVE_BOOT/chroot/boot/initrd.img-* \ $HOME/LIVE_BOOT/staging/live/initrd cat <<'EOF' >$HOME/LIVE_BOOT/staging/isolinux/isolinux.cfg ui menu.c32 prompt 0 menu title Boot Menu timeout 30 label live-amd64 menu label ^Remote-Client (amd64) menu default linux /live/vmlinuz append initrd=/live/initrd boot=live toram EOF cat <<'EOF' >$HOME/LIVE_BOOT/staging/boot/grub/grub.cfg search --set=root --file /DEBIAN_CUSTOM set default="0" set timeout=3 # If X has issues finding screens, experiment with/without nomodeset. menuentry "Remote-Client" { linux ($root)/live/vmlinuz boot=live toram initrd ($root)/live/initrd } EOF cat <<'EOF' >$HOME/LIVE_BOOT/tmp/grub-standalone.cfg search --set=root --file /DEBIAN_CUSTOM set prefix=($root)/boot/grub/ configfile /boot/grub/grub.cfg EOF touch $HOME/LIVE_BOOT/staging/DEBIAN_CUSTOM cp /usr/lib/ISOLINUX/isolinux.bin "${HOME}/LIVE_BOOT/staging/isolinux/" && \ cp /usr/lib/syslinux/modules/bios/* "${HOME}/LIVE_BOOT/staging/isolinux/" cp -r /usr/lib/grub/x86_64-efi/* "${HOME}/LIVE_BOOT/staging/boot/grub/x86_64-efi/" grub-mkstandalone \ --format=x86_64-efi \ --output=$HOME/LIVE_BOOT/tmp/bootx64.efi \ --locales="" \ --fonts="" \ "boot/grub/grub.cfg=$HOME/LIVE_BOOT/tmp/grub-standalone.cfg" (cd $HOME/LIVE_BOOT/staging/EFI/boot && \ dd if=/dev/zero of=efiboot.img bs=1M count=100 && \ mkfs.msdos -F 12 -n 'EFIBOOT' efiboot.img && \ mmd -i efiboot.img ::EFI && \ mmd -i efiboot.img ::EFI/boot && \ mcopy -vi efiboot.img $HOME/LIVE_BOOT/tmp/bootx64.efi ::efi/boot/bootx64.efi ) sudo xorriso \ -as mkisofs \ -iso-level 3 \ -full-iso9660-filenames \ -volid "DEBIAN_CUSTOM" \ -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \ -eltorito-boot \ isolinux/isolinux.bin \ -no-emul-boot -boot-load-size 4 -boot-info-table \ --eltorito-catalog isolinux/isolinux.cat \ -eltorito-alt-boot \ -e EFI/boot/efiboot.img \ -no-emul-boot -isohybrid-gpt-basdat \ -output "${HOME}/LIVE_BOOT/debian-custom.iso" \ "${HOME}/LIVE_BOOT/staging"