Navigation Bar

Saturday, September 28, 2024

Steps to connect from window desktop to a linux server

Below are detailed steps to connect to linux server from windows

Setup Static IP Address on your local windows machine 

On Windows 10

Go to settings -> Network and Internet -> Ethernet -> Change adapter options -> Ethernet -> Properties -> Internet Protocol Version 4 (TCP/IPv4) -> Properties














Click on

Use the following IP address
IP Address - 192.168.56.201
Subnet Mask - 255.255.255.0
Default Gateway - 192.168.56.51
Click on
Use the following DNS server addresses
Preferred DNS server - 8.8.8.8
Alternate DNS server - 8.8.4.4

Click on checkbox Validate settings upon exit, ok and apply

Open a command prompt and verify the IP is showing as per setup

cmd> ipconfig



Assign a static ip address to linux machine. Details are in link below

Assign a static ip address to the linux machine

On the linux machine you will need to install openssh-server
# yum install openssh-server

Once the static ip is setup on both the machines and the ethernet cable is connected restart both the machines.
Now from the windows machine cmd prompt if you ping the linux machine ip you should get a reply.
C:\Users\winni>ping  192.168.56.102

Pinging 192.168.56.102 with 32 bytes of data:
Reply from 192.168.56.102: bytes=32 time=1ms TTL=64
Reply from 192.168.56.102: bytes=32 time=1ms TTL=64
Reply from 192.168.56.102: bytes=32 time=1ms TTL=64
Reply from 192.168.56.102: bytes=32 time=1ms TTL=64

Ping statistics for 192.168.56.102:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms
Now from a power shell as administrator you be be able to connect to a user on the linux server
C:\Users\winni> ssh oracle@192.168.56.102 -X
oracle@192.168.56.102's password:
Activate the web console with: systemctl enable --now cockpit.socket

Last login: Mon May 27 21:17:29 2024 from 192.168.56.201
[oracle@oraclelinux ~]$
Following are the steps to display a remote GUI running on linux using putty, ssh and xming X11 forwarding from windows.

1. Download and install Xming on Windows.
2. Install putty on windows
3. As root user update /etc/ ssh/sshd_config file in linux and restart ssh daemon
4. Install X11 GUI components on linux , including xterm and/or xclock
5. Test the xterm/xclock GUI widget

Step 1

Download Xming from below site
sourceforge site to download Xming

Install Xming-6-9-0-31-setup.exe as per the default installation steps. 
During the installation accept the defaults and when you finish the installation Xming will be running in the background.

Step 2
Download putty from the putty.org website.
Putty is an SSH and telnet client.

In Connection -> SSH -> X11
Click on enable X11 forwarding
In X display location enter localhost:0.0
In Session tab add the following
In hostname (or IP address) - 192.168.56.102
Port - 22
Connection Type - SSH
 Save and load the settings.

With this setting login to the linux server as a suitable user as "oracle"
and verify the DISPLAY environment variable
[oracle@oraclelinux ~]$ echo $DISPLAY
localhost:10.0




Modify /etc/ssh/sshd_config and make sure following lines are set

AllowTcpForwarding yes
AddressFamily inet
X11Forwarding yes
X11UseLocalhost yes  
As root user restart the ssh daemon with the following command
systemctl restart sshd.service
Once this is done as root user install xterm
yum install xterm
After successful installation now on the linux command prompt when you type "xterm" the xterm command line widget should pop up


This signifies the  end of the successful installation of Xming to access you server GUI applications from a windows client.
This setup is very useful to do a GUI based database installations on your linux server or to start sqldeveloper running on linux from you windows client.

References  Using Putty and ssh with Xming X11 Forwarding from Windows to display a remote GUI running in Linux

Thought for the day
Let everything that has breath praise the Lord. Praise the Lord.
Psalm 150:6

With a grateful heart, I thank you Lord for guiding me through this day. Thank You.!!!

No comments:

Post a Comment