Vinagre displays terminal of remote computer, how do I display the desktop instead? - remote-access

I'm having problems displaying a remote desktop in vinagre, I'm using a Mint 20.3 computer to connect to a Debian 11 (xfce desktop) computer on my home network. I can get an ssh connection fine and access the machine by terminal, but I can't get a desktop interface through vinagre.
I start the server on the remote machine with tigervncserver -xstartup /usr/bin/xterm , then make an ssh connection on the local machine using ssh -L 5901:127.0.0.1:5901 remoteusername#ip. Then I use vinagre localhost:1, which brings up a password dialogue, pop in the password then I see a terminal in vinagre connected to the remote machine. Meanwhile, in the local terminal it prints loads of stuff, all prefixed with Gtk-WARNING, here's a sample:
(vinagre:7975): Gtk-WARNING **: 23:55:42.241: Theme parsing error: <data>:2:28: The style property GtkButton:default-border is deprecated and shouldn't be used anymore. It will be removed in a future version
(vinagre:7975): Gtk-WARNING **: 23:55:42.636: Drawing a gadget with negative dimensions. Did you forget to allocate a size? (node box owner ViewAutoDrawer)
My xstartup file reads:
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
I'm following the tutorial at this link and I'm stuck at step 4:
https://computingforgeeks.com/install-and-configure-tigervnc-vnc-server-on-debian/

I solved this by uninstalling tigervnc on the host and installing tightvnc instead. I then edited xstartup to read:
#!/bin/bash
xrdb $HOME/.Xresources
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &
Then, ssh as before from the client:
ssh -L 5901:127.0.0.1:5901 remoteusername#ip
Start the vnc server on the host (with screen res specified):
vncserver -geometry 1280x1024
Finally start vinagre on the client:
vinagre localhost:1
Enter the password then done! Worked for me anyway, please comment if you have any solutions to get tigervnc going, I couldn't get it working properly.

Related

How to open a xterm terminal in a SSH connection with a remote Ubuntu without GUI

I am using Mininet on a remote Ubuntu without GUI. And I am trying to use "xterm h1" to open a terminal on a virtual host in Mininet. But it showed me always there is no display connected. I am trying to use other X application like firefox and it showed me
"No protocol specified
Unable to init server: Could not connect: Connection refused
Error: cannot open display: :0.0"
Then I have set X11forward yes in sshd_config on the remote Ubuntu, and install Xlaunch on my windows but showed no changes.
Can someone tell me how to solve this problem?
PS. I am using a pycharm on Windows11 to establish this SSH session
Since you are running windows you will first need an application that will run an X11 server on your windows, Xming, for example. You will then need to configure your ssh connection to use that xserver. Finally you want to setup the DISPLAY variable at your remote to be LOCAL_IP:0 where LOCAL_IP is the public IP of your machine.

copy/paste from Linux/TigerVNC in macOS via Screen Sharing/Apple Remote Desktop

I have an Oracle Linux 8.5 desktop to which I am connecting via (Apple) Remote Desktop. On the Linux OS I am running TigerVNC server and Gnome WM. Copy/Paste between the two OSes doesn't work. I have configured the following in ~/.vnc/xstartup on the Linux server:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
#added for copy/paste support
vncconfig -nowin &
/etc/X11/xinit/xinitrc
# Assume either Gnome will be started by default when installed
# We want to kill the session automatically in this case when user logs out. In case you modify
# /etc/X11/xinit/Xclients or ~/.Xclients yourself to achieve a different result, then you should
# be responsible to modify below code to avoid that your session will be automatically killed
if [ -e /usr/bin/gnome-session ]; then
vncserver -kill $DISPLAY
fi
It seems I need something like autocutsel to keep the X clipboard and the cutbuffer in sync. However autocutsel is not available for OL 8.x and I tried compiling but I got some errors.
Are there any other solutions to keep these buffers in sync?

How do you copy from tmux (copy mode) running on a remote ssh connection to your local clipboard

I run linux via VirtualBox on OS X. I do this by running my VM in a headless state and then sshing to the linux machine using port forwarding. Right now whatever is copied to my clipboard on my virtual machine I am able to paste on my remote ssh session, but not vice versa (copying from tmux copy mode). I have tried using the following tmux configurations:
setw -g mode-keys vi
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "tmux save-buffer - | ssh host pbcopy"
Unfortunately this is not working... Manually copying using my mouse works but tmux copy mode is more convenient. Any ideas?
This needs integrating tmux buffers with OSX clipboard. What you are trying to do with ssh host pbcopy is just that but I don't think your setup is correct.
host here should be your local OSX machine. And you should have password less key-based trust established between your OSX username and remote user where you are running tmux.
Step 1. Enable SSH on your OSX
Goto System preferences -> Sharing and enable Remote Login. Also remove administrators from the list and add your username.
Step 2. Setup password less login.
These are the steps
Step 3. Replace your host with 192.x.x.x or whatever your OSX's ipaddress is which is reachable from your Virtualbox
I know this question is answered, but just want to provide an alternative solution;
copy text in tmux copy mode from remote host to local system was always a pain for me, I use a windows laptop to SSH into remote system a lot, but apparently there was no good way to do the remote copy, specially when you have more than one screen of text to copy...
so I wrote a tool: rclip, which uses tmux's copy-pipe command to pipe copied text to rclip, and rclip will forward text over network to a rclip process running on local system, which will copy the received text to system clipboard; all communication is authenticated and encrypted via TLS; give it a try, I am quite happy with it

putty + xming: cannot connect to Xserver in Windows 7

I am trying to use putty and XMing to run programs from my Fedora 20. I used this configuration before on other machines and I was able to run GUI programs on Linux and display them in my windows 7. But this time I have trouble and get the "cannot connect to X server" error when I try to launch kwrite and kdesvn which are GUI programs in Fedora 20. The connections were good. And the XMing server was running and the X11 forwarding was enabled in putty, like the instruction here.
From my another Fedora 20 machine, I was able to connect to and run GUI programs from the target machine with ssh -X and the same username. So I am thinking the settings of the target machine was right.
Then what else I can try? how to figure out where the problem is?
Ensure that X11 forwarding is enabled in /etc/sshd_config.
X11Forwarding yes
Ensure in your home directory that you have an .Xauthority file. Permissions should be set 0600. If the file does not exist create it.
touch ~/.Xauthority
chmod 0600 ~/.Xauthority
As was previous stated first make sure that X11 forwarding is enabled in PuTTY.
Config > Connection > SSH > X11 > Enable X11 Forwarding. Based on your question it appears you already did this. Make sure you save this config.
I had a problem much like this, what happened to me was that my DISPLAY was being set elsewhere. If you can, try opening a new settion via putty from the same Windows machine using another user and then checking the display and testing your GUI programs
Another thing would be to use your own user but remove any custom work you may have done in your configuration, login fresh, check the DISPLAY and then test X
Did you enable X11 in putty?
It's under SSH | X11 | Enable X11 Forwarding
Then save the putty profile and click on session | save | open
Should work perfectly after you make those changes.

Eclipse remote debug cannot connect to X server

I'm remote debugging a qt application from one ubuntu machine to another ubuntu one.
I can do it from the console with:
root#eclipsePC# sudo ssh apppcIP -X
root#appPC# export DISPLAY=:0.0
root#appPC# gdb myApplication
Now I'm trying to do the same with Eclipse cdt (starting eclipse with sudo). I've defined the remote connection as a Linux type system. It works for application with no graphics, but for my qt application I get:
Listening on port 2345 Remote debugging from host "myEclipseIP"
myApp: cannot connect to X server
Child exited with status 1
GDBserver exiting logout
I've tried doing
root#appPC# xhost +
root#appPC# export DISPLAY=:ECLIPSEPCIP:0.0
but it didn't work. Anyone knows how to do this?
Thanks
I've added the argument -display ECLIPSEPCIP:0.0 in the debug config and now it starts, but in the appPC instead of the host ECLIPSEPC.
You can enforce ssh X11 forwarding using the ssh config file:
Add the following lines to your $HOME/.ssh/config:
Host apppcIP
ForwardX11 yes
I guess there should be also an option in eclipse to configure -X for the ssh connection, but I'm not sure and have no eclipse for testing. However, the solution shown above will work regardless of eclipse's feature set.
Further, you should not start eclipse as root, also root to root ssh connections are considered insecure. Make sure the regular user can connect to the remote host and execute the necessary commands there.

Resources