6. Linux and Windows interoperability#

6.1. Tools to access the system resources and apps between Linux and Windows.#

  • Setup hostname resolution between Windows 10 and the desktop.

  • Access Linux shell remotely from Windows 10 via SSH client, such as putty.

  • Run GUI applications on Linux remotely by using Xming X-server on Windows.

  • Access Windows desktop remotely from Linux via xfreerdp utility.

  • File system sharing over the network between Linux and Windows via SMB/CIFS.


6.2. Linux desktop and Windows 10 VM communication.#

Both the Linux desktop and Windows 10 should be running on the same VDI node to be able to communicate with each other by their “internal IP” addresses on the 192.168.0.0/24 private network.

fishy

6.3. Windows VDI node settings (Exercise)#

Verify that Windows 10 is located on the same VDI node. Otherwise, migrate it to the node where the Linux desktop is running.

On the VDI portal, enter the settings for the desktop:

fishy

In the Options, check the node assignment:

fishy

Enter Windows 10 Options in the settings. Change the node assignment if it is different from that for the Linux desktop:

fishy

6.4. Name resolution setup of the linux desktop on Win 10 (Exercise)#

Get the “internal IP” address of the Linux desktop from the VDI portal:

fishy

Start Windows 10 in the VDI portal.

Login to Windows 10 via RDP. Use the same username and password as for the VD desktop.

We’ll be accessing the desktop from win10 over the private virtual network. The links below demonstrates how to add the IP address of virbr of your Linux desktop, 192.168.0.214 (your Linux desktop may have different IP address), to the windows host file: Launch Notepad as Administrator,

fishy

navigate to C:\WINDOWS\system32\drivers\etc, and open file hosts,

fishy

add the following line in end of the file.

file content

192.168.0.214 desktop

Save the file:

fishy

Try pinging the desktop by the host name from the command line, cmd: (Links to an external site.)

ping  desktop
fishy

6.5. Windows SSH client (Exercise)#

Windows 10 and 11 come with OpenSSH client installed. In the command prompt, check the version of SSH client:

ssh -V

If the version is below 8.5, it won’t allow running GUI via X11 tunneling on Windows. We’ll use putty.exe SSH.

putty.exe is executable ssh client for Windows. It can be downloaded from here
Normally, you would download the 64 bit executable, putty.exe.

On your win10 desktop, putty is already installed. You can access it in the start menue.

By using putty, SSH to your Linux desktop by using host name desktop. You should be able to login as hostadm.


6.6. X server on Windows 10 (Exercise)#

  • In order to be able to run GUI applications off of Linux remotely, you need to have an X-server on your desktop. Most of the Linux distros come with X.Org. There are commercial and open source X-servers for Windows, for example, Opentext Exceed, Xwin32, X.Org in Cygwin, and Xming.

  • Xming is available for download at Sourceforge

  • On your win10 host, Xming is already installed.

  • Start XLauncher by following the steps below:

fishy fishy

Click next:

fishy

Click next:

fishy

Click finish:

fishy
  • Verify that the X-server is running on the VM: click on “Show hidden icons” on the Taskbar, then bring the cursor to the Xming icon. It should show “Xming Xserver”


6.7. Run ssh client (putty.exe) with X11 forwarding.#

  • Run putty.exe on Windows 10. In the ssh options, enable X11 forwarding as shown in the figures below:

fishy fishy fishy
  • Connect to your Linux desktop, via ssh as user hostadm.

  • In the command prompt, run a GUI application, for example, xeyes. It should pop up a pair of eyes on the desktop.


6.8. Enable RDP service on Windows 10 (Exercise)#

On Windows 10 VM, right click onto the start menu, then select the settings.

In the Remote Desktop section, make sure Remote Desktop is set to ON.

fishy

In the Advanced settings, disable Network Login.

fishy

Add user hostadm to the list of users for Remote Desktop.

fishy

Check the IP address of win10 by running command ipconfig/all in the Command terminal. We’ll need this IP address in the next exercise.

Disconnect the viewer from win10.


6.9. Linux RDP client (Exercise)#

Add the IP address of win10, into /etc/hosts on your desktop for the host name resolution, as below for example.

file content

192.168.0.71     win10

Note, the IP address for your Windows 10 maybe different.

Try pinging win10 to make sure it is accessible from the desktop:

ping -c 3 win10

On your desktop, install freerdp2-x11:

apt install freerdp2-x11

Connect to the Windows RDP as user hostadm:

xfreerdp /u:hostadm /cert-ignore /v:win10

If you need to logout from win10 desktop, please sign out from user hostadm as shown below.

fishy

6.10. Samba (SMB) file sharing from Linux to Windows#


6.11. Samba installation and configuration (Exercise)#

Install samba packages on the Linux desktop:

apt install samba samba-common smbclient

Backup the original samba configuration file, smb.conf:

cd /etc/samba
mv smb.conf smb.conf-orig

Create a new configuration file, smb.conf, in directory /etc/samba with the following content:

file content

# Global parameters:
[global]
    disable spoolss = Yes
    security = USER
    server string = SMB
    workgroup = GROUP16
    idmap config * : backend = tdb


[homes]
    browseable = No
    comment = Home Directories
    path = /home/%S
    read only = No
    valid users = %S

Run command testparm to verify there is no errors in smb.conf:

testparm

Restart the samba services:

systemctl restart smbd
systemctl restart nmbd

Note, you need to restart the services any time after file smb.conf is modified. Create a new user samba account:

smbpasswd -a hostadm

6.12. Access Samba shares on Windows (Exercise)#

You can map the samba share “homes” as a network drive as follows: in the file explorer, right click on “This PC”; slide to map Network Drive; in the folder line, type

file content

\\desktop\homes

Note, in the procedure above, you need to use either the host name or the IP address of your samba server. You can see the accessed shares in the command prompt on Win 10 by running net use:

net use

To unmap one of the shares run:

net use z: /delete

To unmap all the shares, run:

net use * /delete

6.13. SMB file sharing from Windows to Linux#


6.14. Sharing a folder in Windows (Exercise)#

  • On Win 10 virtual desktop, create a new folder, C:\SHARED

  • Share the folder over the network by right clicking on it and slidng down to Properties. Choose Sharing, then advanced sharing, check-in “share this folder”, click onto permissions, select Full Control as demonstrated below:

fishy

6.15. Access Windows shared drive on Linux (Exercise)#

You can access the shared network drive, ‘SHARED’, to list, download and upload files via command smbclient on the Linux desktop as follows:

smbclient //win10/SHARED -U hostadm

then provide the password of hostadm on Win 10 host. To see the list of commands in the smbclient shell, simply type:

?

Create a new folder and upload file /etc/hosts into it by using smbclient

mkdir DIR
put /etc/hosts DIR\hosts
ls
cd DIR
ls
quit

Another way to access the Windows shared drive on Linux is by using smbfs mount. Install smbfs package on the Linux desktop and mount the shared drive:

apt install cifs-utils
mkdir /mnt/smb
mount -t cifs -o username="hostadm",password="unisys" //win10/SHARED /mnt/smb
df -h

You can browse /mnt/smb directory content, copy and delete files in it like on a local file system:

cp /etc/services /mnt/smb
rm -rf /mnt/smb/DIR

Unmount the shared file system:

umount /mnt/smb

6.16. References.#

Xming documentation.

Short but quite informative smb.conf HOWTO

Samba Documentation