Automatic startup of Gnome environement

sorry, for the confusion…

the same way i created office qube with the command line…

That was only valid for my guide, not the @unman’s guide. For VNC you need to create app qube.

i created office2 qube with @unman’s guide. nothing else.

Create the office2 app qube normally in this way:

Don’t use the way you’ve created standalone qube before:

ok, Office3…and now ?

You’ve created disposable qube. Create app qube instead:


Then start the terminal in this app qube and run the script there.

ok, gnome desktop runs at 1920x1280 resolution as desired, many thanks for your support and efforts.

One thing to mention: The gnome desktop starts immediately, bypassing the log in screen.
is this normal behaviour ? How show the login screen first ( as usual) ???

If I select switch user and logout —> the desktop disappears. Why ?

i try to automatically start the gnome script with

crontab -e
@reboot /usr/bin/screen -d -m /home/user/gnome.sh
@reboot /home/user/gnome.sh
with
-rwx-xr-x 1 user user 156 May 25 14:15 gnome.sh

neither the first line nor the second line in crontab works as expected.

How to start the script at boot ?

It’s normal behavior since you’re starting VNC server for user user.

What do you need it for?
I guess you can do this by configuring the VNC server accordingly, maybe something like this:
https://wiki.archlinux.org/title/TigerVNC#Running_Xvnc_with_XDMCP_for_on_demand_sessions
But this is general Linux question and not really specific to Qubes OS.

Because the VNC is running for the user user specifically and not as system service so there is no point trying to switch to another user.

You can try to run the script using .desktop file:

well, the reason why i want to see the login screen, because there i can select “Gnome Classic” for the desktop configuration, which i like annd prefer.

Maybe you can just configure the user to have this Gnome Classic as default desktop configuration?
Try this:

tigervncserver -localhost -xstartup /usr/bin/gnome-session-classic -geometry 1024x768 -SecurityTypes None -useold :1 && xtigervncviewer 127.0.0.1:5901 &

ok, many thanks…it works as expected.

Thank you, I have been following this thread - and it interchangeably covers 2 methods of achieving a Gnome desktop in Qubes: StandaloneVM vs vnc AppVM.
So, I have now attempted unman’s vnc Appvm method with the gnome.sh file.

I am however, when I lauch/run the gnome.sh file in either the Debian template or the Gnome App template (which is based on the debian template) faced with the following error message in both templates - with window heading: [debian-12-gnome] localhost:1 (user) - TigerVNC ; with the AppVM: [gnome-app] localhost:1 (user) - TigerVNC

Oh no! Something has gone wrong. A problem has occurred and the system can’t recover. Please log out and try again.
I am also presented with F8 options.

Logging out and trying again presents the same message.

These are the steps I have taken from the outset:

  1. Created a “debian-12-gnome” TemplateVM - based on the debian-12-xfce (default).

  2. Updated it.

  3. Installed “gnome-shell” within this TemplateVM (chose lightdm).

  4. After this, I have applied, as follows, unman’s instructions to the above “debian-12-gnome” TemplateVM :

  • Installed in the TemplateVM, “debian-12-gnome”: tigervnc-standalone-server and tigervnc-viewer

  • Created a script at /etc/skel/gnome.sh with the following content:

    #!/bin/sh
    tigervncserver -localhost -xstartup /usr/bin/gnome-session -geometry 1024x768 -
    SecurityTypes None -useold :1 && xtigervncviewer 127.0.0.1:5901 &

  • Made it executable: sudo chmod +x /etc/skel/gnome.sh

  1. Created an AppVM called “gnome-app” based on the above TemplateVM, debian-12-gnome.

  2. Attempted to run the gnome.sh file in the TemplateVm and AppVm. Both give the same error message, as described in para 4 above.

There is something I am apparently not doing correctly.

Would someone, including apparatus and unman, please review my steps and advise me as to what it is I have not understood/am doing wrong.

Thanks.

Don’t use xfce template.
Use Qubes Template Manager to install template with the name debian-12 - that’s the debian template with gnome DE.

Thank you, apparatus.
It’s evening here; I will apply your suggestion tomorrow - and will leave some feedback.

Thanks, again, also for this very useful thread!

So, I installed the debian-12 template - and yes, it worked fine. I can now access the gnome desktop and it works well. Thank you.

One issue remains; this is with auto-starting the Vnc and gnome desktop.
I have created a .desktop file in .config/autostart, which calls home/user/gnome.sh.

[Desktop Entry]
Type=Application
Name=gnome-autostart
Exec=“/home/user/gnome.sh”
Terminal=false
X-GNOME-Autostart-enabled=true

In itself, if I run this file in the file manager, this auto start desktop file launches Vnc and the gnome desktop successfully.

But launching the gnome App vm (say from the Qube Manager), only momentarily shows Vnc and the gnome desktop, and F8; it then closes immediately and disappears.

My question: how to auto launch Vnc and gnome at start up?

Another, but minor issue: desktop resolution shows as 1280x966; should be 1280x1024. Gnome doesn’t apply any change I make for the resolution to be 1280x1024. Nor am I able to change it using F8.

It works for me:

user@gnome-vnc:~$ cat ~/.config/autostart/gnome-autostart.desktop
[Desktop Entry]
Type=Application
Name=gnome-autostart
Exec="/home/user/gnome.sh"
Terminal=false
X-GNOME-Autostart-enabled=true
user@gnome-vnc:~$ cat gnome.sh 
#!/bin/sh
tigervncserver -localhost -xstartup /usr/bin/gnome-session -geometry 1920x1080 -SecurityTypes None -useold :1 && xtigervncviewer 127.0.0.1:5901 &

Check the logs in the qube using sudo journalctl.

Edit the -geometry option in the gnome.sh script to change the resolution .

Thanks apparatus. At least knowing that autostart worked for you kept me motivated.

In my current gnome App I have done extensive configuration of other and various things.
So, I decided on trying the autostart on a ‘pristine’ gnome App clone. Yes, the autostart worked!

No luck with the changing geometry to 1280x1024; resolution stays at 1280x966; a minor annoyance.

Thanks for the feedback; it helped a lot.