Using GParted via TigerVNC how to enable on LinuxMint?

Bo Berglund bo.berglund at gmail.com
Mon Jan 6 09:49:22 UTC 2025


On Sun, 05 Jan 2025 16:13:29 -0500, Sam Varshavchik <mrsam at courier-mta.com>
wrote:

>Bo Berglund writes:
>
>> On Sun, 05 Jan 2025 17:32:00 +0100, Bo Berglund <bo.berglund at gmail.com>  
>> wrote:
>>
>> >export XAUTHORITY=/home/UserName/.Xauthority
>>
>> I found an easier solution not needing any script:
>>
>> Edit the user's .bashrc file and add this to it:
>>
>> export XAUTHORITY="/home/username/.Xauthority"
>>
>> (Replace "username" with your own user name.)
>>
>> Then when you log in the env var will be set and therefore all you need to  
>> do is
>> this:
>>
>> In a new terminal window:
>> sudo gparted
>>
>> Now GParted starts and can  be used normally.
>
>I use tigervnc, both the server and the client. When I originally looked  
>into how to set up a VNC, I don't recall where I found the guide, but it  
>told me to create a $HOME/.vnc/xstartup script. Mine reads, for an XFCE  
>desktop:
>
>#!/bin/bash
>unset SESSION_MANAGER
>unset DBUS_SESSION_BUS_ADDRESS
>export XAUTHORITY="$HOME/.vnc/.Xauthority";
>xhost +local:
>xset b off
>cd $HOME
>startxfce4
>
>This ends up setting XAUTHORITY, appropriately, only for my VNC sessions,  
>and without interfering with other stuff, for example I can ssh instead of  
>using VNC, use X11forwarding with the ssh session, as an alternative to VNC  
>(which'll work, I guess, as long as X11 is still here), and have it manage  
>its own XAUTHORITY without interfering with VNC.
>
>Using ~/.vnc/xstartup to set XAUTHORITY seems to be better.

Well, I tred your solution and commented out the line in .bashrc after modifying
the xstartup as you suggested.
Now I cannot start Gparted from the menu (could not previously either) and not
in a terminal by entering:
$ sudo gparted

But when I removed the changes in .bashrc so it sets the environment var from
there, then I could use the terminal command to start it using sudo.

How can I modify the desktop shortcut start such that it runs gparted as sudo?
I tried editing the shortcut and setting permissions to sudo, but no joy!
So far the ONLY way I have found is having the env var in .bashrc and then start
GParted from a terminal window using "sudo gparted".


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list