Problems with VNC in gnome ubuntu 16.04












2















I'm having some strange issues with a fresh VNC server install. I recently built a new Plex server, and it's running gnome Ubuntu 16.04. So far, I've gotten the openSSH server up and running with Google 2FA authentication. Now I'm working on getting vnc working so that I can ultimately run this headless, and remote into it with vnc through SSH when need be.



I started out running just:



sudo apt-get install vnc4server


then, ran vncserver to configure it and set the password, so far, so good.



I then went to my client PC (Windows 10), and attempted to connect without SSH, just to make sure it's working. That's the first issue, upon connecting, I'm getting just a grey screen, which I think is due to the desktop environment not coming up correctly with the connection is made, which I think I can fix by modifying the ~/.vnc/xstartup file.



So back on the server, I ran:



sudo gedit ~/.vnc/xstartup


Now I'm receiving an error, anytime I try to open a gui application as sudo, that error is:



[sudo] password for username:
No protocol specified
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused

(gedit:12145): Gtk-WARNING **: cannot open display: :0


Now I'm lost. I'm 100% sure this is related to VNC, but even shutting down the VNC server doesn't fix it.



Anyone got any ideas? I'm just spinning my wheels and getting frustrated at this point.










share|improve this question























  • See Why should users never use normal sudo to start graphical applications? - in particular, you certainly shouldn't be using sudo to edit your ~/.vnc/xstartup file

    – steeldriver
    Jan 8 '17 at 2:05
















2















I'm having some strange issues with a fresh VNC server install. I recently built a new Plex server, and it's running gnome Ubuntu 16.04. So far, I've gotten the openSSH server up and running with Google 2FA authentication. Now I'm working on getting vnc working so that I can ultimately run this headless, and remote into it with vnc through SSH when need be.



I started out running just:



sudo apt-get install vnc4server


then, ran vncserver to configure it and set the password, so far, so good.



I then went to my client PC (Windows 10), and attempted to connect without SSH, just to make sure it's working. That's the first issue, upon connecting, I'm getting just a grey screen, which I think is due to the desktop environment not coming up correctly with the connection is made, which I think I can fix by modifying the ~/.vnc/xstartup file.



So back on the server, I ran:



sudo gedit ~/.vnc/xstartup


Now I'm receiving an error, anytime I try to open a gui application as sudo, that error is:



[sudo] password for username:
No protocol specified
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused

(gedit:12145): Gtk-WARNING **: cannot open display: :0


Now I'm lost. I'm 100% sure this is related to VNC, but even shutting down the VNC server doesn't fix it.



Anyone got any ideas? I'm just spinning my wheels and getting frustrated at this point.










share|improve this question























  • See Why should users never use normal sudo to start graphical applications? - in particular, you certainly shouldn't be using sudo to edit your ~/.vnc/xstartup file

    – steeldriver
    Jan 8 '17 at 2:05














2












2








2








I'm having some strange issues with a fresh VNC server install. I recently built a new Plex server, and it's running gnome Ubuntu 16.04. So far, I've gotten the openSSH server up and running with Google 2FA authentication. Now I'm working on getting vnc working so that I can ultimately run this headless, and remote into it with vnc through SSH when need be.



I started out running just:



sudo apt-get install vnc4server


then, ran vncserver to configure it and set the password, so far, so good.



I then went to my client PC (Windows 10), and attempted to connect without SSH, just to make sure it's working. That's the first issue, upon connecting, I'm getting just a grey screen, which I think is due to the desktop environment not coming up correctly with the connection is made, which I think I can fix by modifying the ~/.vnc/xstartup file.



So back on the server, I ran:



sudo gedit ~/.vnc/xstartup


Now I'm receiving an error, anytime I try to open a gui application as sudo, that error is:



[sudo] password for username:
No protocol specified
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused

(gedit:12145): Gtk-WARNING **: cannot open display: :0


Now I'm lost. I'm 100% sure this is related to VNC, but even shutting down the VNC server doesn't fix it.



Anyone got any ideas? I'm just spinning my wheels and getting frustrated at this point.










share|improve this question














I'm having some strange issues with a fresh VNC server install. I recently built a new Plex server, and it's running gnome Ubuntu 16.04. So far, I've gotten the openSSH server up and running with Google 2FA authentication. Now I'm working on getting vnc working so that I can ultimately run this headless, and remote into it with vnc through SSH when need be.



I started out running just:



sudo apt-get install vnc4server


then, ran vncserver to configure it and set the password, so far, so good.



I then went to my client PC (Windows 10), and attempted to connect without SSH, just to make sure it's working. That's the first issue, upon connecting, I'm getting just a grey screen, which I think is due to the desktop environment not coming up correctly with the connection is made, which I think I can fix by modifying the ~/.vnc/xstartup file.



So back on the server, I ran:



sudo gedit ~/.vnc/xstartup


Now I'm receiving an error, anytime I try to open a gui application as sudo, that error is:



[sudo] password for username:
No protocol specified
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused

(gedit:12145): Gtk-WARNING **: cannot open display: :0


Now I'm lost. I'm 100% sure this is related to VNC, but even shutting down the VNC server doesn't fix it.



Anyone got any ideas? I'm just spinning my wheels and getting frustrated at this point.







16.04 vnc






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 8 '17 at 2:02









HandOfReformHandOfReform

1112




1112













  • See Why should users never use normal sudo to start graphical applications? - in particular, you certainly shouldn't be using sudo to edit your ~/.vnc/xstartup file

    – steeldriver
    Jan 8 '17 at 2:05



















  • See Why should users never use normal sudo to start graphical applications? - in particular, you certainly shouldn't be using sudo to edit your ~/.vnc/xstartup file

    – steeldriver
    Jan 8 '17 at 2:05

















See Why should users never use normal sudo to start graphical applications? - in particular, you certainly shouldn't be using sudo to edit your ~/.vnc/xstartup file

– steeldriver
Jan 8 '17 at 2:05





See Why should users never use normal sudo to start graphical applications? - in particular, you certainly shouldn't be using sudo to edit your ~/.vnc/xstartup file

– steeldriver
Jan 8 '17 at 2:05










1 Answer
1






active

oldest

votes


















0














Recently I have been struggling with VNC on a Raspberry Pi. I got similar errors like you at the client side.
I decided to install TightVNCserver instead of the default, since TightVNC got many good reviews.
You can install TightVNC on your server (sudo apt-get install tightvncserver).
First stop the other VNC server software or remove it.
Then to test TightVNC, you log in as normal user, and set a VNC password.



$ tightvncpasswd



After that start tightvnc as normal user on your server.



$ tightvncserver



That would start VNC on your server.



Then on your local machine do the following, to build an ssh tunnel :



$ ssh -v remote-username@remote-hostname -L 5901:localhost:5901



This needed because VNC runs at localhost by default, but also needed
to prevent plain text traffic.



After that start Remmina client, and configure it to connect to localhost:5901 with the remote username and the VNC password you created.



When this test works fine, you can continue to create a start-up script
for boot time on your server, or decide to use it manually after each reboot.



Apart from VNC, the x2go is in my opinion nicer and easier to use.
A very cool solution for a remote desktop.
X2go is available in the Ubuntu repositories. For more info have a look here :



http://wiki.x2go.org/doku.php/start






share|improve this answer


























  • Thanks for the suggestion, I tried removing vnc4server, and installing tightvnc, but I'm still getting the grey screen issue when attempting to connect, however a reboot did appear to fix the sudo issue I was having.

    – HandOfReform
    Jan 8 '17 at 6:03












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f869288%2fproblems-with-vnc-in-gnome-ubuntu-16-04%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Recently I have been struggling with VNC on a Raspberry Pi. I got similar errors like you at the client side.
I decided to install TightVNCserver instead of the default, since TightVNC got many good reviews.
You can install TightVNC on your server (sudo apt-get install tightvncserver).
First stop the other VNC server software or remove it.
Then to test TightVNC, you log in as normal user, and set a VNC password.



$ tightvncpasswd



After that start tightvnc as normal user on your server.



$ tightvncserver



That would start VNC on your server.



Then on your local machine do the following, to build an ssh tunnel :



$ ssh -v remote-username@remote-hostname -L 5901:localhost:5901



This needed because VNC runs at localhost by default, but also needed
to prevent plain text traffic.



After that start Remmina client, and configure it to connect to localhost:5901 with the remote username and the VNC password you created.



When this test works fine, you can continue to create a start-up script
for boot time on your server, or decide to use it manually after each reboot.



Apart from VNC, the x2go is in my opinion nicer and easier to use.
A very cool solution for a remote desktop.
X2go is available in the Ubuntu repositories. For more info have a look here :



http://wiki.x2go.org/doku.php/start






share|improve this answer


























  • Thanks for the suggestion, I tried removing vnc4server, and installing tightvnc, but I'm still getting the grey screen issue when attempting to connect, however a reboot did appear to fix the sudo issue I was having.

    – HandOfReform
    Jan 8 '17 at 6:03
















0














Recently I have been struggling with VNC on a Raspberry Pi. I got similar errors like you at the client side.
I decided to install TightVNCserver instead of the default, since TightVNC got many good reviews.
You can install TightVNC on your server (sudo apt-get install tightvncserver).
First stop the other VNC server software or remove it.
Then to test TightVNC, you log in as normal user, and set a VNC password.



$ tightvncpasswd



After that start tightvnc as normal user on your server.



$ tightvncserver



That would start VNC on your server.



Then on your local machine do the following, to build an ssh tunnel :



$ ssh -v remote-username@remote-hostname -L 5901:localhost:5901



This needed because VNC runs at localhost by default, but also needed
to prevent plain text traffic.



After that start Remmina client, and configure it to connect to localhost:5901 with the remote username and the VNC password you created.



When this test works fine, you can continue to create a start-up script
for boot time on your server, or decide to use it manually after each reboot.



Apart from VNC, the x2go is in my opinion nicer and easier to use.
A very cool solution for a remote desktop.
X2go is available in the Ubuntu repositories. For more info have a look here :



http://wiki.x2go.org/doku.php/start






share|improve this answer


























  • Thanks for the suggestion, I tried removing vnc4server, and installing tightvnc, but I'm still getting the grey screen issue when attempting to connect, however a reboot did appear to fix the sudo issue I was having.

    – HandOfReform
    Jan 8 '17 at 6:03














0












0








0







Recently I have been struggling with VNC on a Raspberry Pi. I got similar errors like you at the client side.
I decided to install TightVNCserver instead of the default, since TightVNC got many good reviews.
You can install TightVNC on your server (sudo apt-get install tightvncserver).
First stop the other VNC server software or remove it.
Then to test TightVNC, you log in as normal user, and set a VNC password.



$ tightvncpasswd



After that start tightvnc as normal user on your server.



$ tightvncserver



That would start VNC on your server.



Then on your local machine do the following, to build an ssh tunnel :



$ ssh -v remote-username@remote-hostname -L 5901:localhost:5901



This needed because VNC runs at localhost by default, but also needed
to prevent plain text traffic.



After that start Remmina client, and configure it to connect to localhost:5901 with the remote username and the VNC password you created.



When this test works fine, you can continue to create a start-up script
for boot time on your server, or decide to use it manually after each reboot.



Apart from VNC, the x2go is in my opinion nicer and easier to use.
A very cool solution for a remote desktop.
X2go is available in the Ubuntu repositories. For more info have a look here :



http://wiki.x2go.org/doku.php/start






share|improve this answer















Recently I have been struggling with VNC on a Raspberry Pi. I got similar errors like you at the client side.
I decided to install TightVNCserver instead of the default, since TightVNC got many good reviews.
You can install TightVNC on your server (sudo apt-get install tightvncserver).
First stop the other VNC server software or remove it.
Then to test TightVNC, you log in as normal user, and set a VNC password.



$ tightvncpasswd



After that start tightvnc as normal user on your server.



$ tightvncserver



That would start VNC on your server.



Then on your local machine do the following, to build an ssh tunnel :



$ ssh -v remote-username@remote-hostname -L 5901:localhost:5901



This needed because VNC runs at localhost by default, but also needed
to prevent plain text traffic.



After that start Remmina client, and configure it to connect to localhost:5901 with the remote username and the VNC password you created.



When this test works fine, you can continue to create a start-up script
for boot time on your server, or decide to use it manually after each reboot.



Apart from VNC, the x2go is in my opinion nicer and easier to use.
A very cool solution for a remote desktop.
X2go is available in the Ubuntu repositories. For more info have a look here :



http://wiki.x2go.org/doku.php/start







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 8 '17 at 2:54

























answered Jan 8 '17 at 2:48









albert jalbert j

1,178310




1,178310













  • Thanks for the suggestion, I tried removing vnc4server, and installing tightvnc, but I'm still getting the grey screen issue when attempting to connect, however a reboot did appear to fix the sudo issue I was having.

    – HandOfReform
    Jan 8 '17 at 6:03



















  • Thanks for the suggestion, I tried removing vnc4server, and installing tightvnc, but I'm still getting the grey screen issue when attempting to connect, however a reboot did appear to fix the sudo issue I was having.

    – HandOfReform
    Jan 8 '17 at 6:03

















Thanks for the suggestion, I tried removing vnc4server, and installing tightvnc, but I'm still getting the grey screen issue when attempting to connect, however a reboot did appear to fix the sudo issue I was having.

– HandOfReform
Jan 8 '17 at 6:03





Thanks for the suggestion, I tried removing vnc4server, and installing tightvnc, but I'm still getting the grey screen issue when attempting to connect, however a reboot did appear to fix the sudo issue I was having.

– HandOfReform
Jan 8 '17 at 6:03


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f869288%2fproblems-with-vnc-in-gnome-ubuntu-16-04%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

 ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕