{"id":557,"date":"2015-08-31T22:13:28","date_gmt":"2015-08-31T22:13:28","guid":{"rendered":"https:\/\/www.nicktailor.com\/?p=557"},"modified":"2016-01-03T09:19:57","modified_gmt":"2016-01-03T09:19:57","slug":"how-to-rdp-to-vnc-and-authenticate-using-ad-opensuse","status":"publish","type":"post","link":"https:\/\/nicktailor.com\/tech-blog\/how-to-rdp-to-vnc-and-authenticate-using-ad-opensuse\/","title":{"rendered":"How to RDP  to VNC and authenticate using AD (OpenSuSe)"},"content":{"rendered":"<p>For this we will be setting up VNC server and XRDP which allow you to use windows remote desktop terminal services client to connect to your linux desktop as you would any windows machine with centralized authentication using Active directory.<\/p>\n<p>XRDP is a wonderful Remote Desktop protocol application that allows you to RDP to your servers\/workstations from any Windows machine, MAC running an RDP app or even Linux using an RDP app such as\u00a0<a href=\"http:\/\/remmina.sourceforge.net\/\">Remmina<\/a>.<br \/>\nVirtual Network Computing (<strong>VNC<\/strong>) is a graphical desktop sharing system that uses the Remote Frame Buffer protocol (RFB) to remotely control another computer. Essentially the Linux version of windows RDP.<\/p>\n<p>Now since there was no xrdp package in the opensuse repository it was a bit of dirty install to get it all working.<\/p>\n<p>1. First you will need to install VNC Server using yast2<\/p>\n<ul>\n<li>Yast2 \u2013I tigervnc<\/li>\n<li>Chkconfig vnc on<\/li>\n<li>Vncpasswd &lt;enter&gt;<\/li>\n<li>Type your vncpasswd twice<\/li>\n<li>systemctl start vnc <strong><em>(\/usr\/bin\/vncserver)<\/em><\/strong><\/li>\n<\/ul>\n<p><strong><u>Should like below<\/u><\/strong><\/p>\n<p>New &#8216;X&#8217; desktop is bvanhm01:1<\/p>\n<p>Starting applications specified in \/root\/.vnc\/xstartup<\/p>\n<p>Log file is \/root\/.vnc\/nicktailor.1:1.log<\/p>\n<p>Now we want to install xrdp. Since Opensuse doesn\u2019t come with a built in repository or rpm that has xrdp lalready compiled to use. We will have to make \u00a0this \u00a0setup just a little dirty and compile our own xrdp and then configure it to work the VNC. Im not 100% sure if there is one, however when I looked for one I didn\u2019t see one so I chose this route which worked out. However it is a bit of a dirty setup<\/p>\n<p>First we need to download xrdp source<\/p>\n<ol>\n<li>wget <a href=\"https:\/\/www.nicktailor.com\/files\/xrdp-v0.6.1.tar.gz\">https:\/\/www.nicktailor.com\/files\/xrdp-v0.6.1.tar.gz<\/a><\/li>\n<\/ol>\n<ul>\n<li>Create a directory to store it the source files\n<ol>\n<li><em>cp xrdp-v0.6.1.tar.gz \/home\/xrdp<\/em><\/li>\n<li><em>tar \u2013zxvf \/home\/xrdp\/xrdp-v0.6.1.tar.gz<\/em><\/li>\n<li>zypper install git autoconf automake libtool make gcc gcc-c++ libX11-devel libXfixes-devel libXrandr-devel fuse-devel patch flex bison intltool libxslt-tools perl-libxml-perl font-util libxml2-devel openssl-devel pam-devel python-libxml2 xorg-11<\/li>\n<li>You will also want to enable remote desktop services inside opensuse<\/li>\n<\/ol>\n<\/li>\n<li>Now you want to install xrdp\n<ul>\n<li>change to the xrdp directory and run<\/li>\n<li><em>.\/bootstrap<\/em><\/li>\n<li><em>.\/configure<\/em><\/li>\n<li><em>make<\/em><\/li>\n<li><em>then as root<\/em><\/li>\n<li><em>make install<\/em><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>2. Once the application is installed you will need to add the library files so the system can read it<\/p>\n<ul>\n<li><em>vi <strong>\/etc\/ld.so.conf<\/strong><\/em><\/li>\n<li>add the following lines(32bit &amp; 64bit):\n<ul>\n<li>\/usr\/local\/lib64\/xrdp<\/li>\n<li>\/usr\/local\/lib\/xrdp<\/li>\n<li>save the file<\/li>\n<\/ul>\n<\/li>\n<li>next run <strong><em>ldconfig<\/em><\/strong> so the system pick the libraries directories up.<\/li>\n<li>Make sure your<strong><em> \/etc\/xrdp\/xrdp.ini<\/em><\/strong> has the following<\/li>\n<\/ul>\n<p>[globals]<br \/>\nbitmap_cache=yes<br \/>\nbitmap_compression=yes<br \/>\nport=3389<br \/>\ncrypt_level=high<br \/>\nchannel_code=1<\/p>\n<p>[xrdp1]<br \/>\nname=sesman-Xvnc<br \/>\nlib=libvnc.so<br \/>\nusername=ask<br \/>\npassword=ask<br \/>\nip=127.0.0.1<br \/>\nport=-1<\/p>\n<ul>\n<li>Your start up script for xrdp lives inside <em>\/home\/xrdp\/xrdp-v0.6.1\/instfiles\/xrdp.sh<\/em>\n<ul>\n<li>cd in \/etc\/init.d\/<\/li>\n<li>You can create a symlink inside <em>\/etc\/init.d\/<\/em><\/li>\n<li><em>ln -s \/home\/xrdp\/xrdp-v0.6.1\/instfiles\/xrdp.sh xrdp.sh<\/em><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>Now I added the start up script to \/etc\/rc.d\/boot.local so that it would start up on reboots\n<ul>\n<li>Add this line\n<ul>\n<li><em>\/home\/xrdp\/xrdp-v0.6.1\/instfiles\/xrdp.sh start<\/em><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>For the next portion please ensure you opensuse is already added to AD and authenticating against AD. If not please refer to my earlier blog post on how to add opensuse to Active Directory<\/strong>. <strong>If you did everything correctly your pam.d authentication will be using pam_winbind to authenticate against AD and the following includes will use that authentication process for xrdp to get to VNC<\/strong><\/p>\n<ul>\n<li>Now in order to get xrdp to use AD authentication you will need to update the <em>\/etc\/pam.d\/xrdp-sesman<\/em><\/li>\n<\/ul>\n<p>#%PAM-1.0<br \/>\nauth\u00a0\u00a0\u00a0\u00a0 include\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 common-auth<br \/>\naccount\u00a0 include\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 common-account<br \/>\npassword include\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 common-password<br \/>\nsession\u00a0 include\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 common-session<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>ISSUES YOU CAN RUN INTO WITH GNOME<\/strong><\/span><\/p>\n<ul>\n<li>So now you should be in theory be able to use remote desktop provided there is no firewall preventing you from connecting to the machine, connect using your AD credentials through rdp from a windows desktop. There is small catch. If your using gnome it <b>MAY<\/b>\u00a0not work. What might happen is you will initially connect and then as soon as you get a screen lock, the login screen will be hammering away with you unable to type your password in to gain access to your session again<\/li>\n<li>You might see something like this in your <strong><em>\/var\/log\/messages<\/em><\/strong><\/li>\n<\/ul>\n<p>2015-08-27T14:15:44.341964-07:00 nicktailor01 gnome-session[10533]: ShellUserVerifier&lt;._userVerifierGot@\/usr\/share\/gnome-<br \/>\nshell\/js\/gdm\/util.js:350<\/p>\n<p>2015-08-27T14:15:44.342139-07:00 nicktailor01 gnome-session[10533]: wrapper@\/usr\/share\/gjs-1.0\/lang.js:213<br \/>\n2015-08-27T14:15:44.721076-07:00 bvanhm01 gnome-session[10533]: (gnome-shell:10609): Gjs-WARNING **: JS ERROR: Failed to obtain user<br \/>\nverifier: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: No session available<\/p>\n<p>2015-08-27T14:15:44.721381-07:00 nicktailor01 gnome-session[10533]: ShellUserVerifier&lt;._userVerifierGot@\/usr\/share\/gnome-<br \/>\nshell\/js\/gdm\/util.js:350<br \/>\n2015-08-27T14:15:44.721553-07:00 nicktailor01 gnome-session[10533]: wrapper@\/usr\/share\/gjs-1.0\/lang.js:213<\/p>\n<p>2015-08-27T14:15:45.100944-07:00 nicktailor01 gnome-session[10533]: (gnome-shell:10609): Gjs-WARNING **: JS ERROR: Failed to obtain user<br \/>\nverifier: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: No session available<\/p>\n<ul>\n<li>The reason for this appears to be related to a bug with systemd and gnome-shell. I reviewed several online forum cases regarding it, however there was no solid resolution other than downgrading system. Even later updates caused similar issues. Fear not..there is a solution. I found we can simply change the desktop from gnome to a more stable one like XFCE. How do we do this I will show you \ud83d\ude42<\/li>\n<\/ul>\n<ul>\n<li>First install XFCE\n<ol>\n<li><em>zypper install -t pattern xfce<\/em><\/li>\n<\/ol>\n<\/li>\n<li>Next you want to remove gnome\n<ol>\n<li><em>zypper rm $(rpm -qa | grep gnome)<\/em><\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p>Now reboot your machine and you should be able to remote desktop via rdp to your linux machine with no issues from opensusu. I realize this is bit dirty, but it was fun wasn\u2019t it??? \ud83d\ude42<\/p>\n<p>If you have any questions email nick@nicktailor.com<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For this we will be setting up VNC server and XRDP which allow you to use windows remote desktop terminal services client to connect to your linux desktop as you would any windows machine with centralized authentication using Active directory. XRDP is a wonderful Remote Desktop protocol application that allows you to RDP to your servers\/workstations from any Windows machine,<a href=\"https:\/\/nicktailor.com\/tech-blog\/how-to-rdp-to-vnc-and-authenticate-using-ad-opensuse\/\" class=\"read-more\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"class_list":["post-557","post","type-post","status-publish","format-standard","hentry","category-vnc-rdp"],"_links":{"self":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=557"}],"version-history":[{"count":9,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/557\/revisions"}],"predecessor-version":[{"id":666,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/557\/revisions\/666"}],"wp:attachment":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}