Go back to topic: [Guide] Network Printing using disposable qubes based on Debian-minimal template
>```qvm-features $DISPOSABLE_PRINT_QUBE appmenus-dispvm ''``` | >```qvm-features $DISPOSABLE_PRINT_QUBE appmenus-dispvm ''``` > >```# If you have the Qubes App Menu (qubes-app-menu) installed and would like to add the Document Scanner application to the favorites tab, uncomment the command below:``` > >```#qvm-features $DISPOSABLE_PRINT_QUBE menu-favorites simple-scan``` |
Final Edit: I replaced the ```qvm-copy``` commands with ```cat``` commands in order to remove the need for user action. | Final Edit: I replaced the ```qvm-copy``` commands with ```cat``` commands in order to remove the need for user action. **Actual Final Edit:** At the end of the second script, I added an optional command which adds an item to the Qubes App Menu to start the Document Scanner in the named disposable sys-print qube. |
```# Copy any drivers required for your printer(s) from your STORAGE_QUBE specified at the top of this script ( | ```# Copy any drivers required for your printer(s) from your STORAGE_QUBE specified at the top of this script (adjust commands below to your needs):``` |
```#qvm-run --pass-io $STORAGE_QUBE ' | ```#qvm-run --pass-io $STORAGE_QUBE 'cat /home/user/printer-drivers/<DRIVER_1>.deb' | qvm-run --pass-io $PRINT_TEMPLATE 'cat > /home/user/Downloads/<DRIVER_1>.deb'``` |
```#qvm-run --pass-io $STORAGE_QUBE 'cat /home/user/printer-drivers/<DRIVER_2>.deb' | qvm-run --pass-io $PRINT_TEMPLATE 'cat > /home/user/Downloads/<DRIVER_2>.deb'``` ```#``` ```#qvm-run --pass-io $STORAGE_QUBE 'cat /home/user/printer-drivers/<DRIVER_3>.deb' | qvm-run --pass-io $PRINT_TEMPLATE 'cat > /home/user/Downloads/<DRIVER_3>.deb'``` ```#``` | |
```#qvm-run -u root --pass-io $PRINT_TEMPLATE 'dpkg -i --force-all /home/user/ | ```#qvm-run -u root --pass-io $PRINT_TEMPLATE 'dpkg -i --force-all /home/user/Downloads/<DRIVER_1>.deb'``` |
```#qvm-run -u root --pass-io $PRINT_TEMPLATE 'dpkg -i --force-all /home/user/ | ```#qvm-run -u root --pass-io $PRINT_TEMPLATE 'dpkg -i --force-all /home/user/Downloads/<DRIVER_2>.deb'``` |
```#qvm-run -u root --pass-io $PRINT_TEMPLATE 'dpkg -i --force-all /home/user/ | ```#qvm-run -u root --pass-io $PRINT_TEMPLATE 'dpkg -i --force-all /home/user/Downloads/<DRIVER_3>.deb'``` |
```# | ```# Remove any driver deb files from the Downloads directory:``` |
```#qvm-run -u root --pass-io $PRINT_TEMPLATE 'rm -r /home/user/ | ```#qvm-run -u root --pass-io $PRINT_TEMPLATE 'rm -r /home/user/Downloads/*'``` |
>```# Enable the appmenus-dispvm feature for the disposable template and add the Document Scanner application (simple-scan):``` > | |
>``` | >```qvm-features $DISPOSABLE_PRINT_TEMPLATE menu-items simple-scan.desktop``` |
>```# If you have the Qubes App Menu (qubes-app-menu) installed and would like to add the Document Scanner application to the favorites tab, uncomment the command below:``` > >```#qvm-features $DISPOSABLE_PRINT_TEMPLATE menu-favorites @disp:simple-scan``` > >```# Restrict the disposable template to local network access using firewall rules (adjust for your own network):``` > | |
```# Copy any certificates for your printer(s) from your STORAGE_QUBE specified at the top of this script ( | ```# Copy any certificates for your printer(s) from your STORAGE_QUBE specified at the top of this script (adjust commands below to your needs):``` |
```#qvm-run --pass-io $STORAGE_QUBE ' | ```#qvm-run --pass-io $STORAGE_QUBE 'cat /home/user/printer-certs/cert.crt' | qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'cat > /home/user/Downloads/cert.crt'``` |
```#qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'sudo mv /home/user/ | ```#qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'sudo mv /home/user/Downloads/* /usr/local/share/ca-certificates/'``` |
```# Optionally remove the QubesIncoming directory:``` ```#``` ```#qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'rm -r /home/user/QubesIncoming/'``` ```#``` | |
>```qvm-run - | >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'sudo system-config-printer'``` |
>```# If your printer has scanning functionality that must be activated, uncomment and edit the command below so that the necessary command(s) for your printer/scanner are executed when | >```# If your printer has scanning functionality that must be activated, uncomment and edit the command below so that the necessary command(s) for your printer/scanner are executed when a disposable print qube starts.``` |
>```# Shutdown disposable template:``` | >```# Shutdown the disposable template:``` |
```# Set disposable template as default disposable template:``` | ```# Set the disposable template as default disposable template:``` |
>```# Create named disposable service qube based on the disposable template:``` | >```# Create a named disposable service qube based on the disposable template:``` |
>```# Disable the appmenus-dispvm feature for the named disposable qube``` > | |
Then I added the Document Scanner application from the disposable template (sys-print-template) to the favorites tab of the [Qubes App Menu](https://www.qubes-os.org/news/2021/11/12/new-qubes-application-menu/). | |
I think that I have finally finished editing this post to make corrections. If you notice a mistake or have a suggestion for a better way of doing something in this guide, please reply to this post with your correction/suggestion. | I think that I have finally finished editing this post to make corrections. If you notice a mistake or have a suggestion for a better way of doing something in this guide, please reply to this post with your correction/suggestion. Final Edit: I replaced the ```qvm-copy``` commands with ```cat``` commands in order to remove the need for user action. |
### Introduction: | |
>```# Clone debian-11-minimal template:``` | >```# Clone debian-11-minimal template to make deb11-min-print template:``` |
>```# If your printer(s) | >```# If there are additional drivers required for your printer(s), uncomment the commands below.``` |
```# Copy any drivers required for your printer(s) from your STORAGE_QUBE specified at the top of this | ```# Copy any drivers required for your printer(s) from your STORAGE_QUBE specified at the top of this script (note the expected directory name and location in the command below):``` |
>```qvm-firewall $DISPOSABLE_PRINT_TEMPLATE del -- | >```qvm-firewall $DISPOSABLE_PRINT_TEMPLATE del --rule 0``` |
>```# If you would like to install one or more self-signed certificates generated | >```# If you would like to install one or more self-signed certificates generated by your printer(s) in order to use IPPS encrypted printing, uncomment the commands below.``` |
```# Copy any certificates for your printer(s) from your STORAGE_QUBE specified at the top of this | ```# Copy any certificates for your printer(s) from your STORAGE_QUBE specified at the top of this script (note the expected directory name and location in the command below):``` |
```# Click the "Add" button in the system-config-printer toolbar to begin adding your printer | ```# Click the "Add" button in the system-config-printer toolbar to begin adding your printer.``` |
```# Add any additional printers using the instructions outlined above.``` ```#``` | |
>```# If your printer has scanning functionality that must be activated, uncomment and edit the command below so that the necessary command(s) for your printer/scanner are executed when the print qube starts. | >```# If your printer has scanning functionality that must be activated, uncomment and edit the command below so that the necessary command(s) for your printer/scanner are executed when the print qube starts.``` ```#``` ```# Edit /rw/config/rc.local file to add scanner activation command (example for Brother printer/scanner devices):``` ```#``` >```#qvm-run -u root --pass-io $PRINT_TEMPLATE "sudo echo -e 'sudo brsaneconfig5 -a name=<PRINTER_MODEL_NAME> model=<PRINTER_MODEL_NAME> ip=<PRINTER_IP_ADDRESS>' >> /rw/config/rc.local"``` |
>```#qvm-run -u root --pass-io $PRINT_TEMPLATE "sudo echo -e 'sudo brsaneconfig5 -a name=XXX-XXXXXXX model=XXX-XXXXXXX ip=XX.XX.XX.XX' >> /rw/config/rc.local"``` > | |
>```# Create named disposable service qube | >```# Create named disposable service qube based on the disposable template:``` |
>```qvm-create --class DispVM --template $ | >```qvm-create --class DispVM --template $DISPOSABLE_PRINT_TEMPLATE --prop autostart=false --prop audiovm="" --prop netvm=$NETWORK_QUBE --prop maxmem=0 --prop memory=400 --label gray $DISPOSABLE_PRINT_QUBE``` |
After executing the scripts, I then added a Launcher item into | After executing the scripts, I then added a Launcher item into the Panel to open the Document Scanner application (simple-scan) in the named disposable sys-print qube with the Launcher item set to execute this command: |
Even though the Qui-domains widget in the Panel has options to open a file manager, run a terminal command, and shutdown qubes, I prefer having a set of Launcher items for my named disposable sys-* qubes. Launcher item to shutdown the sys-print qube: | |
Launcher item to open the file manager application (Nautilus) in the sys-print qube: >```qvm-run -q -a --service -- sys-print qubes.StartApp+org.gnome.Nautilus``` Launcher item to open the terminal application (XTerm) in the sys-print qube: >```qvm-run -q -a --service -- sys-print qubes.StartApp+debian-xterm``` | |
* Right-click (secondary-click) a file in any qube, select the "View In DisposableVM" option to open the file in a disposable print qube, and then print the file using ```Ctrl+P```. * Click the Document Scanner Launcher item in the Panel, scan documents in the named disposable sys-print qube and then close the Document Scanner without having the qube automatically shutdown and deleted. Open the file manager by using the Launcher item in the Panel or by using the Qui-domains widget, and then transfer the files to another qube. When transferring files from the named disposable sys-print qube to another qube, they will always appear in the ```/home/user/QubesIncoming/sys-print/``` directory. * Click the Document Scanner item in the Qubes App Menu, scan documents in the disposable qube, open the file manager using the Qui-domains widget in the Panel, transfer the files to another qube, and then close the Document Scanner so that the disposable qube is automatically shutdown and deleted. The transferred files will appear in a subdirectory of ```/home/user/QubesIncoming/``` with the randomly generated name of the disposable qube. * Add printer(s) for temporary use in the named disposable sys-print qube by doing the following: 0. Edit qvm-firewall rules for the sys-print qube if on a different subnet (example: public library) by executing the following commands in the dom0 terminal: * >```qvm-firewall sys-print del --rule 1``` * >```qvm-firewall sys-print add accept <SUBNET>``` * >```qvm-firewall sys-print add drop``` 1. Download any needed drivers for the new printer(s) using an internet-connected qube. 2. Copy the drivers to the sys-print qube and install them. 3. Open the terminal application (XTerm) in the sys-print qube by using the Launcher item in the Panel or by using the Qui-domains widget. 4. Execute this command in the sys-print terminal: * >```sudo system-config-printer```. 5. Add new printer(s). 6. When done printing/scanning, shutdown the sys-print qube. 7. If you added a firewall rule and would like to remove it, execute this command in the dom0 terminal: * >```qvm-firewall sys-print del --rule 1``` I think that I have finally finished editing this post to make corrections. If you notice a mistake or have a suggestion for a better way of doing something in this guide, please reply to this post with your correction/suggestion. |
* print template based on Debian-11-minimal template with packages installed for printing, scanning, and viewing | * print template based on Debian-11-minimal template with packages installed for printing, scanning, and viewing images and documents |
* named disposable qube based on the disposable | * named disposable qube based on the disposable template |
### Script for creating the disposable template and a | ### Script for creating the disposable template and a named disposable qube: |
* Scan documents in a disposable qube, transfer the files to another qube, and then close the window so that the qube is automatically shutdown and deleted. This is quick and convenient, but the transferred files appear in a subdirectory of ```/home/user/QubesIncoming/``` with the randomly generated name of the | * Scan documents in a disposable qube, transfer the files to another qube, and then close the window so that the qube is automatically shutdown and deleted. This is quick and convenient, but the transferred files appear in a subdirectory of ```/home/user/QubesIncoming/``` with the randomly generated name of the disposable qube. |
* | * print template based on Debian-11-minimal template with packages installed for printing, scanning, and viewing of images and documents |
>```qvm-features $DISPOSABLE_PRINT_QUBE appmenus-dispvm ''``` ### After creating the qubes: After executing the scripts, I then added a Launcher item into my Panel to open the Document Scanner application (simple-scan) in my named disposable sys-print qube with the Launcher item set to execute this command: >```qvm-run -q -a --service -- sys-print qubes.StartApp+simple-scan``` I also added a Launcher item to start the sys-print qube: >```qvm-start --quiet sys-print``` And another Launcher item set to shutdown the sys-print qube: >```qvm-shutdown --wait sys-print``` Then I added the Document Scanner application from the disposable template (sys-print-template) to the favorites tab of the [Qubes App Menu](https://www.qubes-os.org/news/2021/11/12/new-qubes-application-menu/). ### Conclusion: With all of this accomplished, I can now do the following: * Right-click (secondary-click) a file in any qube, select the "View In DisposableVM" option to open the file in a disposable qube, and then print the file using ```Ctrl+P```. * Scan documents in a disposable qube, transfer the files to another qube, and then close the window so that the qube is automatically shutdown and deleted. This is quick and convenient, but the transferred files appear in a subdirectory of ```/home/user/QubesIncoming/``` with the randomly generated name of the diposable qube. * Scan documents in the named disposable and then close the window without having the qube automatically shutdown and deleted. When transferring the files from the named disposable to another qube, they will always appear in the ```/home/user/QubesIncoming/sys-print/``` directory, which is more organized than the other method. * Add another printer for temporary use by doing the following: 0. Replace qvm-firewall rules for sys-print qube if on a different network (example: public library). 1. Download any needed drivers for the new printer. 2. Copy drivers to sys-print qube and install them. 3. Click the Qui-domains application widget and select ```sys-print``` then ```Run Terminal```. 4. Execute the command ```sudo system-config-printer```. 5. Add new printer. 6. When done, shutdown sys-print qube and reset qvm-firewall rules. |
>```qvm-features $DISPOSABLE_PRINT_TEMPLATE appmenus-dispvm | >```qvm-features $DISPOSABLE_PRINT_TEMPLATE appmenus-dispvm 1``` |
>```# If your printer has scanning functionality that must be activated, uncomment and edit the command below so that the necessary command(s) for your printer/scanner are executed when the print qube starts. The command below is an example of one needed for Brother printer/scanner devices:``` > >```#qvm-run -u root --pass-io $PRINT_TEMPLATE "sudo echo -e 'sudo brsaneconfig5 -a name=XXX-XXXXXXX model=XXX-XXXXXXX ip=XX.XX.XX.XX' >> /rw/config/rc.local"``` > |
```qvm-clone $SOURCE_TEMPLATE $PRINT_TEMPLATE``` | |
>```qvm-clone $SOURCE_TEMPLATE $PRINT_TEMPLATE``` > | |
```qvm-run -u root --pass-io $PRINT_TEMPLATE 'apt-get install --no-install-recommends cups eog evince gedit ink libusb-0.1-4 nautilus qubes-core-agent-networking qubes-core-agent-passwordless-root simple-scan system-config-printer -y'``` | |
>```qvm-run -u root --pass-io $PRINT_TEMPLATE 'apt-get install --no-install-recommends cups eog evince gedit ink libusb-0.1-4 nautilus qubes-core-agent-networking qubes-core-agent-passwordless-root simple-scan system-config-printer -y'``` > | |
```qvm-shutdown --wait $PRINT_TEMPLATE``` | > >```qvm-shutdown --wait $PRINT_TEMPLATE``` |
```qvm-create --class AppVM --template $PRINT_TEMPLATE --prop autostart=false --prop audiovm="" --prop netvm=$NETWORK_QUBE --prop template_for_dispvms=true --prop maxmem=0 --prop memory=400 --label gray $DISPOSABLE_PRINT_TEMPLATE``` ```qvm-features $DISPOSABLE_PRINT_TEMPLATE appmenus-dispvm ''``` | |
>```qvm-create --class AppVM --template $PRINT_TEMPLATE --prop autostart=false --prop audiovm="" --prop netvm=$NETWORK_QUBE --prop template_for_dispvms=true --prop maxmem=0 --prop memory=400 --label gray $DISPOSABLE_PRINT_TEMPLATE``` > >```qvm-features $DISPOSABLE_PRINT_TEMPLATE appmenus-dispvm ''``` > | |
```qvm-firewall $DISPOSABLE_PRINT_TEMPLATE del --rule-no 0``` ```qvm-firewall $DISPOSABLE_PRINT_TEMPLATE add accept 10.0.0.0/24``` ```qvm-firewall $DISPOSABLE_PRINT_TEMPLATE add drop``` | |
>```qvm-firewall $DISPOSABLE_PRINT_TEMPLATE del --rule-no 0``` > >```qvm-firewall $DISPOSABLE_PRINT_TEMPLATE add accept 10.0.0.0/24``` > >```qvm-firewall $DISPOSABLE_PRINT_TEMPLATE add drop``` > | |
```qvm-run -au root $DISPOSABLE_PRINT_TEMPLATE system-config-printer``` | |
>```qvm-run -au root $DISPOSABLE_PRINT_TEMPLATE system-config-printer``` > | |
```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "[Default Applications]\nimage/ani=org.gnome.eog.desktop" > /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/avif=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/bmp=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/gif=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/ico=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/jpeg=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/pcx=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/png=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/pnm=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/ras=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/svg=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/tga=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/tiff=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/wbmp=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/webp=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/xbm=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` ```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/xpm=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` | |
>```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "[Default Applications]\nimage/ani=org.gnome.eog.desktop" > /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/avif=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/bmp=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/gif=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/ico=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/jpeg=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/pcx=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/png=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/pnm=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/ras=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/svg=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/tga=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/tiff=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/wbmp=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/webp=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/xbm=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > >```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'echo -e "\n[Default Applications]\nimage/xpm=org.gnome.eog.desktop" >> /home/user/.config/mimeapps.list'``` > | |
```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'sudo mkdir -p /rw/config/qubes-bind-dirs.d'``` | |
>```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'sudo mkdir -p /rw/config/qubes-bind-dirs.d'``` > | |
```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'sudo mkdir -p /rw/bind-dirs/etc/cups/'``` | |
>```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'sudo mkdir -p /rw/bind-dirs/etc/cups/'``` > | |
```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'sudo cp -r /etc/cups/* /rw/bind-dirs/etc/cups/'``` | |
>```qvm-run --pass-io $DISPOSABLE_PRINT_TEMPLATE 'sudo cp -r /etc/cups/* /rw/bind-dirs/etc/cups/'``` > | |
```qvm-run -u root --pass-io $DISPOSABLE_PRINT_TEMPLATE "sudo echo -e binds+=\( \'/etc/cups/\' \) > /rw/config/qubes-bind-dirs.d/50_user.conf"``` | |
>```qvm-run -u root --pass-io $DISPOSABLE_PRINT_TEMPLATE "sudo echo -e binds+=\( \'/etc/cups/\' \) > /rw/config/qubes-bind-dirs.d/50_user.conf"``` > | |
```qvm-shutdown --wait $DISPOSABLE_PRINT_TEMPLATE``` | |
>```qvm-shutdown --wait $DISPOSABLE_PRINT_TEMPLATE``` > | |
```#qubes-prefs default_dispvm $DISPOSABLE_PRINT_TEMPLATE``` | |
>```#qubes-prefs default_dispvm $DISPOSABLE_PRINT_TEMPLATE``` > | |
```qvm-create --class DispVM --template $PRINT_TEMPLATE --prop autostart=false --prop audiovm="" --prop netvm=$NETWORK_QUBE --prop maxmem=0 --prop memory=400 --label gray $DISPOSABLE_PRINT_QUBE``` ```qvm-features $DISPOSABLE_PRINT_QUBE appmenus-dispvm 1``` | > >```qvm-create --class DispVM --template $PRINT_TEMPLATE --prop autostart=false --prop audiovm="" --prop netvm=$NETWORK_QUBE --prop maxmem=0 --prop memory=400 --label gray $DISPOSABLE_PRINT_QUBE``` > >```qvm-features $DISPOSABLE_PRINT_QUBE appmenus-dispvm 1``` |
```# Move | ```# Move certificate(s) to the proper directory for importing:``` |
```# Import | ```# Import certificate(s):``` |
* Print template based on Debian-11- | * Print template based on Debian-11-minimal template |
* | * named disposable qube based on the disposable template (not required, but useful for copying multiple files to a single print qube) |
Script for creating the template: | It is also worth noting that the second script is configured to set the Eye Of Gnome package (eog) as the default program for viewing image files. File types that are not supported by Eye Of Gnome will open in the default image viewer (currently ImageMagick). ### Script for creating the template: |
Script for creating the disposable template and a named-disposable qube: | ### Script for creating the disposable template and a named-disposable qube: |
```#``` | |
>```# Create | >```# Create named disposable service qube (useful if you would like to be able to copy multiple files into one disposable print qube):``` |
>```# Make /rw/bind-dirs/ sub-directory for | >```# Make /rw/bind-dirs/ sub-directory for /etc/cups/ directory:``` |
```#Copy any drivers required for your printer(s) from your STORAGE_QUBE specified at the top of this script:``` | |
```# Copy any drivers required for your printer(s) from your STORAGE_QUBE specified at the top of this script:``` ```#``` | |
```qvm-create --class AppVM --template $PRINT_TEMPLATE --prop autostart=false --prop audiovm="" --prop netvm=$NETWORK_QUBE --prop template_for_dispvms=true --prop maxmem=0 --prop memory=400 --label | ```qvm-create --class AppVM --template $PRINT_TEMPLATE --prop autostart=false --prop audiovm="" --prop netvm=$NETWORK_QUBE --prop template_for_dispvms=true --prop maxmem=0 --prop memory=400 --label gray $DISPOSABLE_PRINT_TEMPLATE``` |
>```# If you would like to install one or more self-signed certificates generated on printer(s) in order to use IPPS encrypted printing, uncomment the commands below.``` | >```# If you would like to install one or more self-signed certificates generated on your printer(s) in order to use IPPS encrypted printing, uncomment the commands below.``` ```#``` |
```#qvm-run --pass-io $STORAGE_QUBE 'qvm-copy /home/user/ | ```#qvm-run --pass-io $STORAGE_QUBE 'qvm-copy /home/user/printer-certs/*'``` |
```# For IPPS encrypted printing, input the following into text field titled "Enter device URI":``` | ```# For IPPS encrypted printing, input the following into the text field titled "Enter device URI":``` |
```qvm-create --class DispVM --template $PRINT_TEMPLATE --prop autostart=false --prop audiovm="" --prop netvm=$NETWORK_QUBE --prop maxmem=0 --prop memory=400 --label | ```qvm-create --class DispVM --template $PRINT_TEMPLATE --prop autostart=false --prop audiovm="" --prop netvm=$NETWORK_QUBE --prop maxmem=0 --prop memory=400 --label gray $DISPOSABLE_PRINT_QUBE``` |