When following guides, it is often asked to edit files, most often in template but sometimes in qubes themselves.
This is a guide that explain on a template by template basis, how to edit a file. The audience are beginners who do not know how to edit files from a terminal or very little experience with Linux.
Graphical text editor
debian-13 or fedora-43 based templates / qubes (not xfce!)
- edit the qube settings
- open tab “Applications”
- click on “Text editor” on the left panel to highlight it
- click on
to move “Text editor” to the list on the right - click on button “Ok”
Now you can start the editor in that qube from the Qubes OS menu. In the Text Editor program, click on the top left button “Open”, then click on the “Icon” in the small popup and browse the file system to find the file you want to edit. If you need to create a new file, write the content then save to the location you want.
Note that if you edit a file that should be edited as root (the admin user), Text Editor will automatically escalate privileges to have the permissions to edit the file, this is possible without password because qubes do not have a root password by default.
You can start the program from the terminal using gnome-text-editor and you can add a parameter to it for a file location if you want. This does not work if you add sudo to this command.
debian-13-xfce or fedora-43-xfce or fedora-42-xfce based templates / qubes
- edit the qube settings
- open tab “Applications”
- click on “Mousepad” on the left panel to highlight it
- click on
to move “Mousepad” to the list on the right - click on button “Ok”
Now you can start the editor in that qube from the Qubes OS menu. In the program Mousepad, click on the menu “File”, then click on “Open” browse the file system to find the file you want to edit. If you need to create a new file, write the content then save to the location you want.
Note that if you edit a file that should be edited as root (the admin user), you need to start Mousepad from the terminal to run it as root:
- open a terminal in the qube
- type
sudo mousepad - you can close the terminal once you finished with Mousepad
Command line
If you are not afraid of typing commands in a terminal to edit a file, here is what you need to look for. It is a valuable skill to know how to use a terminal text editor.
All Qubes OS templates
All templates in Qubes OS feature two editors by default: nano and vi. You might want to do an internet search to figure how to use them, as they have no buttons to click to achieve actions, nor they have the usual shortcuts (like ctrl+s to save):
Some links to get started:
- a guide to use nano: https://linuxize.com/post/how-to-use-nano-text-editor/
- a guide to use vi: An introduction to the vi editor