Home > Uncategorized > Linux, Windows and related fun…

Linux, Windows and related fun…

So let me make this clear. I am NO Linux expert, in fact I barely touch it. I have a web server running an old version of SuseLinux under my desk that I NEVER touch. The web site is just static pages, easily updated simply by replacing them and it works so why mess with something that is not broken!

That said, my wife recently ‘donated’ here old desktop PC to me as she was not using it any more. It’s a decent machine (DELL) but running Windows 10 it was sooooo sloooooow it was painful to use. So I decided to put Linux on it as I had something that I wanted to run on it long term and the problem with Windows is that, in its wisdom it periodically just updates itself and reboots the PC.

So, I downloaded the latest OpenSuse iso, burnt a CD and installed it. Well, after about two days of fighting with it, I installed it!. Most of the installs were because I’d configure it, decide that was not what I wanted (Figuring out which desktop to use was the worst, settled on Gnome in the end but only after about four different attempts at the install) and so it was just easier to wipe it al out and start again.

 

So, now to the whole point of this post.  My workspace is pretty large (it’s actually made from a kitchen counter top) but also pretty cluttered so having yet another screen, mouse and keyboard on there was not really an option.

My primary monitor had a spare VGA input so I used that but I still had to switch the display over and put the mouse/keyboard on my desk while I used the Linux box and picking up the wrong mouse or typing on the wrong keyboard soon got annoying.

So I looked into remote access.

At first I looked at using X11 but after a lot of messing and experimenting I decided it was messy to set up, still needed a lot of knowledge to use and really only brought individual apps over to the Windows desktop, not the whole Gnome desktop. I am no power user so I need all the help I can get and configurig individual Linux apps to run via X11 on my Windows desktop just seemed like a lot of extra work!

So I opted for VNC which gives you the full desktop experience.

Now you’d think that this would be easy and like all things, once you know how, it is but getting to that stage still took a couple of days! So this is the output from that ‘learning’ experience.

I am running Windows 10 and OpenSuse Leap 15.1 so this information should work for that configuration but like all software, as it moves forward (for better or worse!) who knows how long it will stay valid. Still…

One Time Setup Stuff

So first off, on the Linux box, using Yast, in in Network Services Remote Administration (VNC) , I set:

Allow Remote Administration with Session Management
The alternative was:
Allow Remote Administration without Session Management

I have no idea how that changes things, except perhaps in relation to sessions staying active when I disconnect the remote VNC session.

So then I used Putty on the Windows box to connect to my Linux box, LINBOX:

I set:

Hostname LINBOX Port 22
Under Connection:SSH:Tunnels add
Source port 5901
Destination LBOX:5901

I then saved that as a profile for future use.

 

I needed to do this next bit because up to this point, I could connect with VNC to my Linux desktop but all I got was a black screen. So for this next bit of the setup I needed to edit a file on the Linux box as a root user but rather than login as root, apparently never a good idea, I logged in as myself then did the following:

sudo vncserver                      This will start session with ROOT authority (enter root password when prompted)
Note session number or use vncserver -list to list sessions numbers (should be only one at this stage!)

Back on Windows I launched my VNC viewer (Tightvnc in my case) using host:port (so it was LINBOX:2) in my case
You will connect as root so enter root password when/if prompted.

This put me into my Gnome desktop on the Linux box.

I then selected the files application from the application pull down on the desktop menu and navigated to:

/etc/gdm/custom.conf

I then right clicked on custom.conf and selected edit (so you are now editing this file as a root user).

Locate [xdmcp] and just below it add this line:
Enable=true

Then save the file, exit the files application and
logoff as root (top right corner of screen)
End vnc session (close the widow)

Now back in the putty command window, restart xdm by entering:

sudo systemctl restart xdm

Now kill that vncserver process (the one that was using root) with

vncserver -kill :n n was 2 in my case (see above)

And that’s it for the one time setup stuff.

 

Regular Logon

You should now be able to VNC as a regular user to your desktop (Gnome in my case) as a regular user as follows:

Start putty as before and select the same LINBOX config options

Hostname LINBOX Port 22
Under Connection:SSH:Tunnels add
Source port 5901
Destination P390:5901

Login with your user id and password
Issue:
vncserver This will start session as a normal user. NOTE NO SUDO command before vncserver.
Note session number or use vncserver -list to list sessions

Launch VNC Viewer or Tightvnc using host:port (so LINBOX:3 if the session number from vncserver was 3)
Enter YOUR password if required

And you should be good to go!!!

Also note that at this point you can close the putty window (type exit) and your VNC session will still work.

You can also just close the VNC window and come back to it later and it’s all still there, with apps open etc. No need to do the putty/vncserver steps, just use the same session number as before.

When you area ‘really’ done on your Linus desktop, open a putty window to your server as before and type:

vncserver -kill :n

Where n is the session number you were using. This will get rid of the background process.

I installed Regina Rexx and wrote a little exc to automate a lot of the regular logon stuff. It’s not perfect because it has hard coded passwords in it and currently only establishes a new session, cannot reuse an old one but it’s a start (and fun to figure out how to do anyway!)

I believe you can get around the hard coded password problem by setting up certificates to authenticate the session/user but that’s way beyond me at this point in time.

 

Here’s my (suspended) Linux Gnome desktop in a VNC window on my Windows desktop.

LinuxVNC

 

 

 

 

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: