📜 ⬆️ ⬇️

RDP (non) thin client with Linux based on Nettopes (Nvidia ION, Intel Atom)

In today's age of pervasive virtualization, there is a need to save on everything. The most significant entities for any system administrator are:

In my article, I consider the implementation of a (non) thin client based on Linux OS as a layer between the hardware component and the familiar Windows interface.
(Not) thin client, in my understanding, is a Linux distribution kit with the following properties:


As a platform for implementation, I chose Nvidia ION because:

Also, I will need one 4GB USB flash drive, which will be the replacement for the hard drive.

The Linux distribution was chosen for installation by openSUSE. Currently it is version 12.2

Well, let's get started ...

About the wonderful project Suse Studio wrote a lot . With it, we will create the final solution of the terminal (non) thin client:
')
Create a new solution:



As you can see, the choice is rich:



We need the easiest solution, so we use the template: “minimal graphic system with IceWM shell”.



Now you can equip our distribution!

Software

This out-of-the-box solution already contains the necessary components for running the graphics system and the lightweight window manager.
If everything is left by default, it may take a lot of effort to configure this system (video driver, network settings, etc.). I also need a solution: put the address hammered and forgot.

Add the following components (dependent packages will be added automatically):

Add drivers for Nvidia ION video cards from the Nvidia repository:


Add drivers for Intel video cards from the repository:


(Great article on which Nvidia video driver to choose)

Delete:


Configuration

General : Be sure to change the root password and specify our default user.

Startup : Graphic Login

Desktop : with our user’s automatic login

Here you can set the parameters when loading, which we will do:

In the light of version 12.2 out of date:

setkxbmap -model pc104 -layout us, ru -variant,
Our keyboard has 104 buttons with 2 layouts

setkxbmap -option grp: alt_shift_toggle
and it will switch by alt + shift


(sleep 3; xfreerdp -u domain\\user -f server_ip &) 

so that the user does not have the desire to start learning Linux
the delay is necessary if ip-address is received via DHCP, icewm sometimes gets faster.
(or rdesktop -k en-us -u domain \\ user -f server_ip)

 echo 'ShowTaskBar=0' >> ~/.icewm/preferences 

hide the taskbar (more fully here )

For special custom settings, you can register additional commands in any number of.

For the first run settings, go to the next section:

Scripts

In the section First Boot add a couple of lines:
OpenSuse 12.1
 grep -rl 'timeout 10' /boot/grub/ | xargs perl -i -pe "s/timeout 10/timeout 0/g;" 

OpenSuse 12.2 (Grub2)
 grep -rl 'GRUB_TIMEOUT=10' /etc/default/grub | xargs perl -i -pe "s/GRUB_TIMEOUT=10/GRUB_TIMEOUT=0/g;" 

set the timeout for selecting OS boot options 0 seconds

 echo '* * * * * if ! ps -U tux | grep xfreerdp && ps -U tux | grep icewm; then perl /home/rdp_conn_cnt; fi' >> /var/spool/cron/tabs/tux 

Add to our user (who may accidentally end the RDP session, autostart RDP client). Optionally, you can make a smaller period of time.

 chmod u+s /sbin/shutdown 

We use our user to turn off the computer

 chmod u+s /sbin/ipconfig 

and watch ip

Files

Actually, here I have uploaded my simple script that counts the number of attempts to launch RDP when the user has not entered anything. When the number of attempts expires, the system will shut down.
 #!/usr/bin/perl $counter = 0; if (-e "/tmp/rdp_cnt.tmp"){ open (FN, "/tmp/rdp_cnt.tmp") or die "$_"; $cnttext=<FN>; close FN; $counter = $1 if ($cnttext =~ /(\d+)/); } if ($counter++ < 10){ system("export DISPLAY=:0 && xfreerdp -u domain\\\\user -f server_ip"); open (FN, ">/tmp/rdp_cnt.tmp") or die "$_"; print FN $counter."\n"; close FN; } else { unlink("/tmp/rdp_cnt.tmp") if (-e "/tmp/rdp_cnt.tmp"); system ("systemctl poweroff"); } 


Build

To build an image ready!
Make Preload ISO (.iso) and can be set.

Source: https://habr.com/ru/post/144822/


All Articles