Linux and Windows interoperability
Contents
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 Windows desktop remotely from Linux via xfreerdp utility.
Access Linux shell remotely from Windows 10 via SSH client, such as putty.
Run GUI applications remotely on Linux from Windows desktop by using Xming X-server on Windows.
File system sharing over the network between Linux and Windows via SMB/CIFS.
6.2. Windows 10 virtual appliance deployment in KVM (Exercise)¶
Start Windows 10 in the VDI portal.
Make sure both the Windows 10 and the desktop are running on the same VDI node. Check it in the Options for both the hosts.
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. Verify it by running command ipconfig/all
on your Windows 10.
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.218 (your Linux desktop may have different IP address), to the windows host file: Launch Notepad as Administrator,
navigate to C:\WINDOWS\system32\drivers\etc
, and open file hosts,
add the following line in end of the file.
file content
192.168.0.218 desktop
Save the file:
Try pinging the desktop by the host name from the command line, cmd: (Links to an external site.)
ping desktop
6.3. 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.
In the Advanced settings, disable Network Login.
Add user hostadm to the list of users for Remote Desktop.
Disable the Windows firewall for the Domain and the Private networks. This can be done by navigating to the Settings, then Updates & Security -> Windows Security -> Firewall & Network protection.
Disconnect the viewer from the VM.
6.4. Linux RDP client (Exercise)¶
On your desktop, install freerdp2-x11
:
apt-get 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.
6.5. Windows SSH client (Exercise)¶
Make sure ssh server is running on your desktop:
systemctl status sshd
It should show Active (running) status.
putty.exe is executable ssh client for Windows.
It can be downloaded from here
Please download the 64 bit executable, putty.exe
.
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, download and install Xming.
Start XLauncher by following the steps below:
Click next:
Click next:
Click finish:
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:
Connect to your Linux desktop, via ssh as user hostadm.
In the command prompt, run a GUI application, for example, gimp. It should start the gimp graphics editor on the desktop.
6.8. Samba (SMB) file sharing from Linux to Windows¶
6.9. Samba installation and configuration (Exercise)¶
Install samba packages on the Linux desktop:
apt-get 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.11. SMB file sharing from Windows to Linux¶
6.12. 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 advinced sharing, check-in “share this folder”, click onto permissions, select Full Control as demonstrated below: