When Running GUI with root privileges you get the following:

cannot connect to X server

There are several ways to solve this problem.

Answer 1:

When launch anyplaceusb got no GUI only the frame and the title.

The terminal shows

X Error: BadAccess (attempt to access private resource denied) 10

 Extension:    130 (MIT-SHM)

 Minor opcode: 1 (X_ShmAttach)

 Resource id:  0x164

X Error: BadShmSeg (invalid shared segment parameter) 128

 Extension:    130 (MIT-SHM)

 Minor opcode: 5 (X_ShmCreatePixmap)

 Resource id:  0xc0

X Error: BadDrawable (invalid Pixmap or Window parameter) 9

 Major opcode: 62 (X_CopyArea)

 Resource id:  0x2800010

X Error: BadDrawable (invalid Pixmap or Window parameter) 9

 Major opcode: 62 (X_CopyArea)

 Resource id:  0x2800010

X Error: BadDrawable (invalid Pixmap or Window parameter) 9

 Major opcode: 62 (X_CopyArea)

 Resource id:  0x2800010

A temporary workaround is to run it with

$sudo QT_X11_NO_MITSHM=1 anyplaceusb

Answer 2:

Try

$ su -

$ anyplaceusb

Answer 3:

You need to allow the root user access to the X server.

$xhost local:root

And point the command to the right DISPLAY

$sudo DISPLAY=$DISPLAY gedit /etc/profile

Answer 4:

Add the line:

Defaults env_keep="DISPLAY XAUTHORITY"

at the end of visudo.

To do that you have to run

$sudo visudo

It will open the file then add the above line at the end.