homehowtokbslinksaboutcontactprojectsmusic

Index > Help Tutorials > Citrix PXE Boot Agent
Install base file system
Install Citrix workspace [64 bit]
Install zoom media plugin
Install GUI (xfce)
Create USB Rules
Updates
Compress/Uncompress

Install GUI (xfce4)

  1. Install xfce4
    apt update; apt install xfce4 --no-install-recommends
    
  2. Install X initializer
    apt install xinit
  3. Install audio/video and graphic packages
    apt install libc++-dev v4l-utils curl alsa pavucontrol zenity libnotify-bin xfce4-notifyd usbutils x11-xserver-utils libpcsclite1 libcanberra-gtk-module libgtkglext1
    
    Archived packages
    notification-daemon
  4. Configure notification daemon auto start
    cat << eot > /etc/xdg/autostart/notification-daemon.desktop
    [Desktop Entry]
    Name=Notification Daemon
    Comment=Display notifications
    Exec=/usr/lib/notification-daemon/notification-daemon
    Terminal=false
    Type=Application
    OnlyShowIn=GNOME-Flashback;XFCE
    NoDisplay=true
    X-Ubuntu-Gettext-Domain=notification-daemon
    eot
    
  5. Configure xfce4 autostart
    cat << eot >> /root/.profile
    
    # Start GUI
    if [ $(tty) == "/dev/tty1" ]
    then
            exec /usr/bin/startxfce4
    fi
    eot
    
Go up

Install Citrix Workspace [64bit]

  1. Download the packages you need https://www.citrix.com/downloads/workspace-app/linux/workspace-app-for-linux-latest.html
  2. Copy packages to the base file system
  3. Install prerequisites
    apt install v4l-utils curl libwebkit2gtk-4.0-37 libc++1 libcanberra-gtk-module libcanberra-gtk3-module libgtkglext1 libidn11
    
  4. Install workspace (adjust the version)
    dpkg -i icaclient*.deb
    
  5. Install USB support
    dpkg -i ctxusb*.deb
    
  6. Disable CTRL+ALT+DEL
    systemctl mask ctrl-alt-del.target; systemctl daemon-reload
    
Citrix workspace tweaks
  1. Disable UVC (default via HDX RealTime Webcam Video Compression)
    sed -i s,'DENY:  class=0e # UVC (default via HDX RealTime Webcam Video Compression)','#DENY:  class=0e # UVC (default via HDX RealTime Webcam Video Compression)',g /opt/Citrix/ICAClient/usb.conf
    
  2. Hide menu bar
    sed -i s,'ConnectionBar=*','ConnectionBar=0',g /opt/Citrix/ICAClient/config/All_Regions.ini
    
    Double check the above to be ConnectionBar=0 as it might instert ConnectionBar=0*
  3. Configure start-up modes Enable desktop appliances mode
    sed -i s,'DeferredUpdateMode = True','DeferredUpdateMode = True\nDesktopApplianceMode = True',g /opt/Citrix/ICAClient/config/module.ini
    
  4. Enable audio input
    sed -i s,'CDMAllowed=On','CDMAllowed=On\nEnableAudioInput=True',g /opt/Citrix/ICAClient/config/wfclient.template
    
  5. Allow audio input
    sed -i s,'CDMAllowed=On','CDMAllowed=On\nAllowAudioInput=True',g /opt/Citrix/ICAClient/config/wfclient.template
    
  6. Allow remote flash: Optional
    sed -i s,'CDMAllowed=On','CDMAllowed=On\nHDXFlashUseFlashRemoting=Always',g /opt/Citrix/ICAClient/config/wfclient.template
    
Now you have desktop environment and citrix workspace installed so let do a cleanu and compress the system again
  1. Clear caches
    apt-get autoremove; apt-get autoclean; apt-get clean; rm /var/lib/apt/lists/*
    
  2. Remove some unnecessary files/folders and remove wireless drivers from kernel (optional)
    rm -r /usr/share/GeoIP ; rm -r /usr/share/man ; rm -r /usr/share/doc
    rm -r /lib/modules/$(uname -r)/kernel/net/wireless; rm -r /lib/modules/$(uname -r)/kernel/drivers/net/wireless
    
  3. Compress the updated system (.gz)
    cd $ctx; find . -print0 | sudo cpio --null -ov --format=newc | gzip -9 > ~/ctxboot.gz
    
  4. Compress the update system (.xz)
    cd $ctx; find . -print0 | sudo cpio --null -ov --format=newc > ~/ctxboot; xz -zvf -9 -C crc32 ~/ctxboot
    
  5. Congrats ! Your base file system is compressed and ready
Go up

Create base file system

Create and configure base file system
  1. Install package needed to create core image
    apt install debootstrap
    
  2. Create base file system [64 bit]
    ctx=/ctx; debootstrap --arch amd64 focal $ctx
    
  3. Delete existing timezone and locals setting from base system and copy the timezone, locals from local system to base system
    rm $ctx/etc/{timezone,localtime}; cp /etc/{timezone,localtime} $ctx/etc
    
  4. Create modules directory and copy intended kernel to it
    mkdir -pv $ctx/lib/modules; cp -r /lib/modules/$(uname -r) $ctx/lib/modules/
    
  5. Copy the repository links and set the hostname
    cp /etc/apt/sources.list $ctx/etc/apt; echo "localhost" > $ctx/etc/hostname
    
  6. Login to base system (chroot)
    chroot $ctx
    
  7. Configure timezone and local time
    locale-gen en_US.UTF-8; update-locale LANG=en_US.UTF-8; dpkg-reconfigure -u tzdata
    
  8. Patch the base system
    apt update; apt upgrade -y
    
  9. Install base packages
    apt install nano xterm ssh dmidecode wget dnsutils -y
    
  10. Disable IPv6
    Add the following as kernel argument
    ipv6.disable=1
    
  11. Create init script (very important) and make it executable
    cat << eot > /init
    #!/bin/sh
    mkdir -p /dev/{,pts,ptmx}
    
    # Mount file system in ram.
    mount -a
    
    init=/sbin/init
    exec \${init}
    eot
    chmod a+x /init
    
  12. Create rule to change nic name to eth0
    cat << eot > /etc/udev/rules.d/70-persistent-net.rules
    # PCI device 0x11ab:0x4363 (sky2)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
    ATTR{address}=="00:00:00:00:00:00",ATTR{dev_id}=="0x0", ATTR{type}=="1",
    KERNEL=="eth*", NAME="eth0"
    eot
    
  13. Configure the base system for dhcp
    cat << eot > /etc/netplan/config.yaml
    network:
      version: 2
      renderer: networkd
      ethernets:
        eth0:
          dhcp4: true
    eot
    
  14. Clear caches
    apt-get autoremove; apt-get autoclean; apt-get clean; rm /var/lib/apt/lists/*
    
  15. Remove some unnecessary files/folders and remove wireless drivers from kernel (optional)
    rm -r /usr/share/GeoIP ; rm -r /usr/share/man ; rm -r /usr/share/doc
    rm -r /lib/modules/$(uname -r)/kernel/net/wireless; rm -r /lib/modules/$(uname -r)/kernel/drivers/net/wireless
    
  16. Configure autologin for root account
     sed -i s,"^ExecStart=-/sbin/agetty.*","ExecStart=-/sbin/agetty -a root --noclear %I $TERM",g /etc/systemd/system/getty.target.wants/getty\@tty1.service
    
    Verify the auto login
    grep "ExecStart" /etc/systemd/system/getty.target.wants/getty\@tty1.service | grep root
    
  17. Setup password for root (optional)
    passwd
    
    Logout from base system (chrooted)
    exit
    
  18. Compress the base system (.gz)
    cd $ctx; find . -print0 | sudo cpio --null -ov --format=newc | gzip -9 > ~/ctxboot_$(date +%Y%m%d-%H%M).gz
    
  19. Compress the base system (.xz)
    cd $ctx; find . -print0 | sudo cpio --null -ov --format=newc > ~/ctxboot_$(date +%Y%m%d-%H%M); xz -zvf -T0 -9 -C crc32 ~/ctxboot_$(date +%Y%m%d-%H%M)
    
  20. Congrats ! Your base file system is compressed and ready Go up

Install zoom media plugin

  1. Download plugins, the version and download link may vary
    wget https://zoom.us/download/vdi/3.1.1/zoomcitrixplugin-ubuntu_amd64.deb
  2. Install required libs
    apt install libxcb-keysym1
  3. Install zoom media plugin
    dkpg -i zoom*.deb
Go up

Create USB Rules

  1. Create rule for USB sound card reference
    cat << eot > /etc/udev/rules.d/00-usb.rules
    KERNEL=="pcmC[D0-9cp]*", ACTION=="add", PROGRAM="/bin/sh -c 'K=%k;K=\$\${K#pcmC}; K=\$\${K%%D*}; echo defaults.ctl.card \$\$K > /etc/asound.conf; echo defaults.pcm.card \$\$K >>/etc/asound.conf'"
    KERNEL=="pcmC[D0-9cp]*", ACTION=="remove", PROGRAM="/bin/sh -c 'echo  defaults.ctl.card 0 > /etc/asound.conf; echo defaults.pcm.card 0 >>/etc/asound.conf'"
    eot
    
  2. Reload rules
    udevadm control --reload-rules && udevadm trigger
    
  3. Rule monitor console
    udevadm monitor --kernel --property --subsystem-match=usb
    
  4. Plug/Unplug any usb device to see the triggers actions
Go up

Updates

2021-01-28

Packages before installing Citrix workspace
apt install libpcsclite1 libcanberra-gtk-module libgtkglext1 libc++-dev v4l-utils curl
v4l-utils curl libwebkit2gtk-4.0-37 libc++1 libcanberra-gtk-module libcanberra-gtk3-module libgtkglext1 libidn11
Go up

Compress/Uncomress

unzip xz image, assuming main.xz is the image name and its located in /var/www/html/ipxe/imgs/dvlp direcotry
cd /var/www/html/ipxe/imgs/dvlp; unxz -v main.xz
expand the compressed image file (cpio archive type), mnt direcotry is under /var/www/html/ipxe/imgs/dvlp/mnt
cd mnt; cpio -idvu < ../main
now we have our base system in mnt directory so chroot (recommended) to it and make any changes if needed
chroot /var/www/html/ipxe/imgs/dvlp/mnt
Exit out of chroot once all done and compress the boot system
exit
change directory
cd /var/www/html/ipxe/imgs/dvlp/mnt
create cpio file system with contents of above directory
find . -print0 | sudo cpio --null -ov --format=newc > /var/www/html/ipxe/imgs/dvlp/main
compress above file using xz compression
xz -zvf -9 -C crc32 /var/www/html/ipxe/imgs/dvlp/main
Go up