Linux Commands

How to Access Another Computer on the Same Network with Linux?

There are many reasons for accessing another computer on the home or office network from your laptop or desktop. For example,

  1. Using Graphical Software Remotely: There are many software that needs high-spec computers to run (i.e., Autodesk Maya, AutoCAD, Blender). Your laptop or desktop may not have the required specs to run the software. At times, particular software can only run on a specific operating system that you don’t want to install just for that software. In these cases, you can install the required graphical software on other computers and access them remotely from your laptop or desktop and use the required graphic software.
  2. Solving Problems Remotely: If you’re the tech guy in your office, at times, you may need to solve problems on the computers of your colleagues or show them how to do something. You can remotely connect to your colleague’s computer and solve his or her situation. This will save you a lot of time as it doesn’t require you to spend time walking to go to your colleague’s room.
  3. Remote Graphical/Command-Line Administration: You may be a system administrator of a company. The company may have a lot of computers that you need to administer. Going from desk to desk or room to room to assist every single computer of your company will be a lot of hassle. Instead, you can sit and relax on your desk and remotely connect the computers you need to administer from your laptop or desktop. This will save you a lot of time and extra work.
  4. Accessing Virtual Machines: You may want to run virtual machines on your server using Type-I hypervisors like Proxmox VE, VMware vSphere, KVM, etc. In that case, to use the virtual machines, you need to remotely connect to the virtual machines from your laptop or computer as these virtual machines won’t have any physical display, keyboard, or mouse.

In this article, I will show you different methods of accessing other computers and virtual machines on the same network with Linux. So, let’s get started.

Connecting to Other Linux Computers via SSH

You can connect to other Linux computers on your network from the command-line via SSH. The remote computer must have the OpenSSH server program installed for SSH to work.

If you need any assistance on installing the OpenSSH server on your computer, depending on the Linux distribution you’re using, read one of the following articles:

To connect to the remote computer via SSH, you need to know the remote computer’s IP address. If you’re unaware of the IP address of the remote computer, ask your colleague to open a Terminal on the remote computer and run the following command:

$ hostname -I

Once your colleague finds out the IP address of his or her computer, he or she can send it to you. In my case, the IP address is 192.168.0.109. Since every computer has its unique IP address, then it will be different from yours. So, make sure to use your IP address.

You also need to know the username and the login password of the remote computer. Again, your colleague can send it to you.

Once you know the login username, password, and IP address of the remote computer, you can connect to it via SSH as follows:

$ ssh <username>@<ip-addr>

NOTE: Replace <username> with the login username and <ip-addr> with the IP address of the remote computer.

As you’re connecting to the remote computer via SSH for the first time, you will see the following prompt.

Type in yes and press <Enter> accept the fingerprint.

Type in the login password of the remote computer and press <Enter>.

You should be connected to the remote computer via SSH.

Now, you can run any command you want on the remote computer.

Connecting to Windows Computers via RDP:

The most common way to connect to a remote Windows computer is via RDP (Remote Desktop Protocol). The RDP protocol is built-in to the Windows operating system. So, you don’t need to install anything on the remote Windows computer for RDP to work. All you need to do is, enable RDP on the remote computer, and you’re good to go.

To enable RDP on Windows 10, open the Windows 10 Settings app and click on System, as shown in the screenshot below.

Navigate to the Remote Desktop section and click on the Enable Remote Desktop toggle button, as shown in the screenshot below.

Click on Confirm, as shown in the screenshot below.

RDP should be enabled.

Once RDP is enabled on the remote Windows machine, you need to know the remote Windows machine’s IP address.

To find the IP address of the remote Windows machine, press the <Windows> key and press R.  The Run prompt window should be displayed. Now, type in powershell or cmd and press <Enter>.


A Terminal (PowerShell or CMD, depending on the command you used to start the terminal) should be opened.


Now, run the following command:

> ipconfig /all


The IP address of the remote Windows computer should be displayed. In my case, the IP address is 192.168.0.107. It will be different for you. So, make sure to use your unique IP address.


Once you know the Windows computer’s IP address, you can use an RDP client to connect to the remote Windows computer from Linux. There are many RDP clients available on Linux. In this article, I will use the Vinagre remote desktop client to connect to the Windows computer via RDP.

If you don’t have the Vinagre remote desktop client installed on your computer, and if you need any assistance installing the Vinagre remote desktop client on your desired Linux distribution, you can check the article How to Install Vinagre Remote Desktop Client on Linux.

Once you have Vinagre installed, you can start it from the Application Menu of your computer.

To start Vinagre, open the Application Menu and search for Vinagre and click on the Remote Desktop Viewer icon as shown in the screenshot below.


The Vinagre remote desktop client should be opened.


Now, click  Connect.


Select RDP from the Protocol drop-down menu, type in the IP address of your Windows computer in the Host section, and type in the display Width and Height in pixels in the RDP Options section as marked in the screenshot below.


Then, click on Connect.


You will be asked to type in the login username and password of the Windows computer you’re connecting to.

Type in the login username and password and click on Authenticate.


You should be connected to the Windows computer, as you can see in the screenshot below.

Connecting to Remote Computers via VNC:

VNC (Virtual Network Computing) is a protocol for accessing and controlling the graphical desktop environment of a computer remotely from another computer.

To connect to a computer remotely via the VNC protocol, you must have the VNC server program installed and configured on the computer that you want to access remotely.

If you need any assistance on installing the VNC server on your computer, depending on the Linux distribution you’re using, read one of the following articles:

Once you have the VNC server installed on your remote computer, you need a VNC client to connect to your remote computer from another computer.

There are many VNC clients available on Linux. i.e., Vinagre, Remmina, RealVNC VNC Viewer, etc.

If you need any assistance installing a VNC client on your desired Linux distribution, you can read one of the following articles depending on the VNC client you want to install.

Vinagre: Read the article How to Install Vinagre Remote Desktop Client on Linux.

RealVNC VNC Viewer: Read the article How to Install RealVNC VNC Viewer on Linux.

In this article, I will use the RealVNC VNC Viewer VNC client to show you how to connect to a remote computer using the VNC protocol.

Once RealVNC VNC Viewer is installed, you can start VNC Viewer from the Application Menu of your desired Linux distribution.


Check the I have read and accept these terms and conditions checkbox and click on OK, as shown in the screenshot below.


Click on GOT IT as marked in the screenshot below.


VNC Viewer should be ready to connect to remote computers.


To connect to your remote computer via VNC, you need to know the IP address of that remote computer.

Run the following command on the remote computer to find its IP address.

$ hostname -I


The IP address of the remote computer should be printed on the terminal.

As you can see, the IP address of the remote computer I want to connect to is 192.168.0.106. It will be different from yours. So, make sure to replace it with your IP address.


Now, to connect to a remote computer, type in the hostname or IP address of the remote computer you want to connect to and press <Enter>.


Click on Continue.


You will be asked to type in the login username and password of the remote computer.


Type in the login username and password of the remote computer you want to connect to and click on OK, as shown in the screenshot below.


You should be connected to the remote computer.

Connecting to VMware Virtual Machines via VMRC:

To connect to VMware vSphere or VMware ESXi virtual machines remotely, you can use the official VMware program VMware Remote Console (VMRC).

To learn more about VMware Remote Console (VMRC) and how to install it on your favorite Linux distribution, check the article How to Install VMRC (VMware Remote Console) on Linux.

To show you how to connect to a VMware ESXi virtual machine with VMware Remote Console (VMRC), I have prepared a VMware ESXi virtual machine s01, as you can see in the screenshot below.


To connect to the VMware ESXi virtual machine s01 with VMware Remote Console (VMRC), click on Console, as shown in the screenshot below.


Then, click on Launch remote console, as shown below.


The VMware ESXi virtual machine s01 should be opened with VMware Remote Console (VMRC), as you can see in the screenshot below.

Connecting to Proxmox Virtual Machines via SPICE:

To connect to Proxmox VE virtual machines remotely, you can use the official KVM Virt Viewer. Virt Viewer uses the SPICE protocol to connect to KVM virtual machines remotely.

To learn more about KVM Virt Viewer and how to install it on your favorite Linux distribution, check the article How to Install Virt Viewer on Linux.

To show you how to connect to a Proxmox virtual machine via the SPICE protocol using Virt Viewer, I have prepared a Proxmox virtual machine s02, as you can see in the screenshot below.


To be able to connect to a Proxmox virtual machine with Virt Viewer, you must set the Display Hardware of the virtual machine to SPICE (qxl) as shown in the screenshot below.


Once you’ve set the virtual machine’s Display hardware to SPICE (qxl), navigate to the Console section of the virtual machine and click on Console > SPICE as marked in the screenshot below.


Your browser should prompt you to open or save the Virt Viewer connection configuration file.

Select Open with, select Remote Viewer from the drop-down menu, and click on OK, as shown in the screenshot below.


You should be connected to the Proxmox virtual machine as you can see in the screenshot below.

Conclusion:

In this article, I have shown you how to access a remote computer on the same network from Linux. I have shown you different methods, protocols, and tools to connect to remote computers from another computer on the same network.  Also, text-based remote access protocol SSH, graphical remote access protocols RDP and VNC, Proxmox virtual machine’s remote access protocol SPICE, and VMware ESXi or VMware vSphere virtual machine’s remote access tool VMRC were covered. Other than that, I have shown you how to use the remote access client programs Vinagre, RealVNC VNC Viewer, Virt Viewer, and VMRC to connect to remote computers via their supported remote desktop protocols as well.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.