Thursday, April 30, 2015

w Command



Hello everyone,

Yesterday, I came across a very useful command that I thought it's very helpful/useful to share with everybody if you don't know it already. The command is called "w". Yes, just w.

                                                                            Figure 1 



w shows who is logged on the server or machine and  what they are doing. Referring to Figure 1, I just ran w command and it shows me that currently two persons logged in to server. Under USER column, the second user is me "ktaraghi" that ran w command and you can see it under WHAT column.

Let me explain in more details:
The first row, as you see in Figure 1, shows useful information about machine, users and processes. So, the first item in the first row shows the current time and the second item shows how long the system has been running. The third item shows how many users are currently logged on and the last item shows the system load averages for the past 1, 5, and 15 minutes.

The second row, shows column headers which are (from left to right): Usernames currently logged in, the tty name or terminal name, the login time, idle time, JCPU and PCPU. According to man page, the JCPU time is the time used by all processes attached to the tty and it doesn't include past background jobs, but does include currently running background jobs.
The PCPU time is the time used by the current process, named in the "WHAT" column.


There are some switches that is used with this command.
w -h :Don't print the headers

                                                                             Figure 2

w -s :Short format. Don't print the login name, JCPU, and PCPU.

                                                                              Figure 3

w -f :Adds another column "FROM" which shows remote hostname or IP

                                                                               Figure 4

and finally, -V which shows the version of w command.
Hopefully you enjoyed,
Regards,
Khosro Taraghi
 

Monday, March 2, 2015

Configuring Open Virtual Desktop (OVD) on RedHat/CentOS/Fedora (Part 2)

Hello everyone,

In Part 1 (http://ktaraghi.blogspot.ca/2015/02/installing-open-virtual-desktop-ovd-on.html ), I showed you how to install OVD and add Linux and Windows server to Session Manager and also how to install the Web Portal.
Now, I am going to show you how to configure and launch and publish Windows and Linux
applications. First, we need to create some users.

Click on User tab in Admin console. You have different options here. You can either type them manually and add them to internal database (Figure 1) or ask system to create and populate some random username for you (Figure 2). Also, you can import users from directory service located at Configuration ->Domain integration setting (Figure3, 4):


                                                                           Figure 1

                                                                      Figure 2

                                                                                    Figure 3

                                                                                      Figure 4

Then, you need a user group. On the same User tab, click on User Groups and create a
group. Here I named them All Employee.

                                                                       Figure 5


                                                                                Figure 6

You have a couple of options here that you can assign to groups if you want to, such as
session setting, time restrictions, remote desktop setting and etc…

                                                                                    Figure 7

Now, you need to create a group for applications. Go to Application ->Application Groups. I
create 2 groups for myself. One for Linux apps and one for Windows app.

                                                                                  Figure 8

Then, add desired applications to both application groups:

                                                                                 Figure 9

The same process for Windows group:

                                                                                   Figure 10

                                                                                  Figure 11

And finally, to release applications to users, Go to Application tab and then click on
Publications. Then map the desired groups to desired application groups:

                                                                                       Figure 12

Now, Go to web portal, in this case http://web.ovd.com/ovd/
I am going to show you both Desktop and Portal mode. In Desktop mode, enter your
credentials and click on Connect:

                                                                             Figure 13

As soon as you connect, which is really fast (thanks to HTML5), you will see your desktop and
all your mixed Linux and Windows applications:

                                                                                 Figure 14

                                                                                 Figure 15

In Portal mode, which is a really good mode for smart phones and tablets, you will see all
application icons arranged like tiles beside each others:

                                                                                Figure 16

Other configurations in Admin console are pretty much self explanatory. The last thing that is
good to know is that you are able to see not only active sessions but also to see a history of
all sessions:

                                                                            Figure 17

                                                                            Figure 18

And that’s all. Hope you enjoyed.
Khosro Taraghi

Info and Cited work (for both part1 and part 2 of this article):

Ulteo Open Virtual Desktop v4.0.2 Red Hat Enterprise Linux (RHEL) 6.0 support. 2014. 03
March 2015 < http://archive.ulteo.com/ovd/4.0/docs/Support_RHEL_6.0.html > .


Saturday, February 28, 2015

Installing Open Virtual Desktop (OVD) on RedHat/CentOS/Fedora (Part 1)

Hello everyone,
Today, I am very excited to talk about Open Virtual Desktop (OVD). If you are looking for
merging Linux and Windows applications and access them all over Internet/network via your
browser, desktop, tablets, or your smart phone with the same speed as running those
applications on the actual server, OVD is that what you need.

OVD has two editions. One is Community Edition (free edition) that we are going to talk about
that today and the other one is Enterprise Edition. Both have the same functionality except
that Enterprise edition has support, updates, patches, native client and the SSL gateway for
access via the Internet.

To install and configure the OVD, we need at least 3 or 4 servers in production environments
(a Session Manager, an Application Server or Subsystem, a Windows Server
(2003/2008/2012 only) for Windows applications, a Web Portal and a
SSL/Gateway(enterprise only) for production environment), however, for demonstrating
purposes and lack of resources, I am going to install all of them in one server except Windows
server. So, total 2 servers for my purpose.

The server that I am working on is CentOS 6.6 but the process of installation should be the
same as all RedHat families. Let’s install OVD:

The first thing you need to do is disabling SELinux because Ulteo OVD is not compatible with
SELinux yet, which I don’t like to disable SELinux personally but no choice for now:

sestatus
vi /etc/selinux/config
and set SELINUX=disabled
reboot

                                                                        Figure 1

Then, you need to add Ulteo rpm repository into your server. Create a file called ovd.repo in
/etc/yum.repos.d/ and add following lines in the file:

vi /etc/yum.repos.d/ovd.repo

[ovd4.0.2]
name=Ulteo OVD 4.0.2
baseurl=http://archive.ulteo.com/ovd/4.0/rhel/6.0/
enabled=1
gpgcheck=1
gpgkey=http://archive.ulteo.com/ovd/4.0/rhel/6.0/keyring



                                                                          Figure 2

Session Manager Installation:

First, you need to create a database. The easiest way to install a database is MySQL
database. To install MySQL and create a database for Session Manager, follow the
instructions below:

yum install mysql mysqlserver → install MySQL package
chkconfig mysqld on → To start automatically MySQL when the system boots up
service mysqld start → Start the service
mysqladmin -u root password 'your_password_here' → Define the root mysql password
mysql -u root -p -e 'create database ovd' → Create a database for ovd Session Manager

Now, install Session Manager and Administration Console:
yum install ulteo-ovd-session-manager ulteo-ovd-administration-console

Launch the configuration tool (needs access to Internet):
sm-config

                                                                           Figure 3

Launch the Administration Console configuration tool (press Enter to accept the default local
host address if the Session Manager is in the same machine or enter the ip address of
Session Manager):

ovd-administration-console-config

                                                                            Figure 4

Restart Apache service:
chkconfig httpd on → To start automatically Apache when the system boots up
service httpd restart

Since I don’t have DNS server here, I am going to use host entry in /etc/hosts file. We need 3
FQDN records (Session Manager, Application Server, Web Portal):

vi /etc/hosts → add following lines below:
127.0.0.1 sm.ovd.com
127.0.0.1 app.ovd.com
127.0.0.1 web.ovd.com

Now, we need to configure our Session Manager. Go to this url:
http://sm.ovd.com/ovd/admin
and login to admin page:

                                                                            Figure 5

Since this is the first time that you login to admin, it will redirect you to setup page for
database. Enter your root credentials for database and click Save:

                                                                              Figure 6

Now, you need to adjust the timezone in PHP setting, do the followings:
vi /etc/php.ini
date.timezone = America/Toronto → Change the timezone accordingly; you can find a list
of timezones here: http://php.net/manual/en/timezones.php
then, restart apache:
service httpd restart

                                                                             Figure 7

Application Server / File Server Installation:

It’s time to set up your Application Server or Subsystem. First, you need to install your
subsystem package:
yum install ulteo-ovd-subsystem

Due to a conflict, you may have to uninstall samba packages before installing the
ulteo-ovd-session-manager package. Remove the samba client and server packages:
yum remove samba*

then launch the configuration tool:
ovd-subsystem-config

                                                                              Figure 8

Configure and start the Ulteo service:
chkconfig ulteo-ovd-subsystem on
service ulteo-ovd-subsystem restart


Now that you have installed and configured your Application or Subsystem, go back to admin
page and click on Unregistered servers under Servers and you will see your Application
server is there. Just click on Register to register your Application server.

                                                                                   Figure 9

After clicking on Register button, if you have followed my instructions, you may see the
following message:
Server "localhost": redirection name may be invalid!

                                                                               Figure 10

To fix that, click on localhost and enter the following info:
Display name: Linux Apps → Whatever name you like and then click on Define
Internal name (fqdn): localhost → use localhost and then click on Change
Redirection name for this server: app.ovd.com → I used fqdn that I defined in /etc/hosts and
then click Change

I disabled fs role since I don’t want to use it.
Then click on Switch to production button.

Note:
The redirection name is used when launching sessions. When you launch a session, you are
redirected to an Application Server using the redirection name as target host.

                                                                               Figure 11

                                                                                   Figure 12

Web Portal Installation:

We need the following packages to install Web Portal:
yum install ulteo-ovd-web-client ulteo-ovd-web-client-ajaxplorer ulteo-ovd-guacamole

The HTML5 client is enabled by installing ulteo-ovd-guacamole package. By default, it's based on using Tomcat 6 server.

Launch the configuration tool:
ovd-web-client-config

                                                                                   Figure 13

Configure and restart tomcat and apache:

service httpd restart
chkconfig tomcat6 on
service tomcat6 restart
chkconfig guacd on
service guacd start


Now, you need to open port 80 on your web portal server. Run the following command:

iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT


then go to the link below to open the Web Portal:
http://web.ovd.com/ovd/

                                                                          Figure 14

By using HTML5, you will find out that how much it’s fast. Thanks to HTML5. And you have 2
modes. Desktop mode and Portal mode. Desktop mode gives you a familiar environment, like
desktop computers. Portal mode gives you tile icons which is really good for use in smart
phones. I will show you in part 2 of this article.

Windows Application Server Installation:

The goal was configuring OVD to serve both Linux and Windows application in one place. In
other words, merging both Linux and Windows applications together and using them in
browser or desktop mode. Now, in order to add a Windows Application server, we need either
a Windows 2003 or a Windows server 2008 or a Windows server 2012.
Next, download Ulteo Open Virtual Desktop Windows agent from link below and install it in
Windows server:
http://www.ulteo.com/main/downloads/ulteoovdwin.php

OVD Windows agent installation is fairly easy but I will show here:
Click Next,

                                                                           Figure 15

Leave the default and click Next. Then, you can either put IP address or fqdn of Session
Server:

                                                                              Figure 16

Click on Next and installation will start. After installation finished, click on Reboot to reboot
your server:

                                                                            Figure 17

Then go back to admin page and click on Servers >Unregistered Servers. You should see
the Windows server there. Click on Register button:

                                                                           Figure 18

Next, click on IP address under Name column:

                                                                            Figure 19

Display name: Win Apps → Whatever name you like and then click on Define
Internal name (fqdn): IP address of Win Server → then click on Change
Redirection name for this server: IP address of Win Server → then click Change
Then click on Switch to production:

                                                                               Figure 20

and finally you should the following servers on Server page (figure 21)

                                                                               Figure 21

This is the end of part 1. In part 2, I will show you how to configure Session Manager to serve
both Linux and Windows applications.
Hope you enjoyed,
Khosro Taraghi