Tuesday, December 30, 2014

Enabling VNC in Ubuntu 14.04 (Trusty Tahr)

I had the interesting request to configure VNC for a user running Ubuntu 14.04 today, although with slightly different requirements than normal. The user wanted to connect via VNC, and go straight to the Ubuntu Unity desktop. At first glance this seems easy, but then I wouldn't be writing this.

From everything I found, the Unity desktop is not designed to work well with VNC. Googling "ubuntu vnc desktop" returned multiple pages of people configuring their systems with vnc4server or tightvnc, but then configuring the system to load gnome or some other desktop. Never did anyone successfully get VNC working with the unity desktop.

A bit more searching and I found a reference to Ubuntu Desktop Sharing. It appears that Ubuntu comes with a built-in VNC server named vino. By opening the search tool and typing in Desktop Sharing or Vino, you can configure the sharing preferences. Enable Allow other users to view your desktop, Allow other users to control your desktop, Require the user to enter this password, and enter a password.
When the settings are saved, there is one more option to set. Open a terminal window and type the following:
gsettings set org.gnome.Vino require-encryption false
This configures the necessary encryption settings to allow a remote client to access the VNC server.

Using a VNC Viewer on another system, such as the one from RealVNC, connect to the system by IP or name. When prompted, enter the password, and you will be presented with your desktop.

Only 1 problem remains at this point - if the user logs off or reboots, the VNC server goes away with it. Once gone, you have to log into the GUI manually, and then the VNC server is started again. In my instance, I am working with only 1 user on this system, so I am able to use auto-login.

Again, open the search tool and type in Login. This pops up the user configuration tool, where you can select your user and enable auto-login.
Once completed, reboot the system and watch it automatically login your user. And because the user is configured for Desktop Sharing, the VNC server starts automatically, thereby sharing out the desktop.

Wednesday, December 24, 2014

Finding Unused VMs in VMware

With the great capabilities of VMware, comes one of the drawback - VM sprawl. On a whim, someone can call IT and spin up a VM (or a dozen VMs), but then immediately forget about them. There are a great many tools that help track this - assigning VMs to users and automating the reclamation cycle - but those tools only work after they have been installed.

So, you have a VM farm with 2,000 virtual machines and you are running out of resources - how can you identify which ones to reclaim? There are various ways to track who was the last person to log into each system, and then hunt them down for details about it, and hopefully they are willing to take responsibility for the machine and state if it can be reclaimed or not. But for 2,000 VMs, that would take forever, there must be an easier method to target only questionable systems....

Enter Virtual Center performance metrics. By default, Virtual Center gathers several metrics about every VM in its environment. Of these, 3 are particularly useful for this problem: Network KBps, Disk KBps, and CPU MHz. These metrics help us determine how many KB of network traffic has occurred, how many KB of information was read/written from the guest OS, and how many MHz the VM used. Virtual Center retains this information for daily, weekly, monthly, and even yearly periods.

Using the below TSQL script, I was able to gather basic information about each virtual machine, as well as summarized performance information for the Disk, Network, and CPU. Sorting this data from smallest-to-largest allows you to quickly identify VMs that may not be used at all, or possibly are under used and can be consolidated.

select vms.VMID, vms.NAME, vms.MEM_SIZE_MB, vms.NUM_VCPU, vms.BOOT_TIME, vms.POWER_STATE, vms.GUEST_OS, vms.DNS_NAME, vms.IP_ADDRESS, moid.MOID
,(select SUM(hsd.STAT_VALUE)
from VPXV_HIST_STAT_MONTHLY hsd (NOLOCK)
where hsd.Entity = moid.MOID
and hsd.STAT_GROUP='disk'
and hsd.STAT_NAME='usage'
and hsd.STAT_ROLLUP_TYPE='average') as 'DiskKB'
,(select SUM(hsd.STAT_VALUE)
from VPXV_HIST_STAT_MONTHLY hsd (NOLOCK)
where hsd.Entity = moid.MOID
and hsd.STAT_GROUP='net'
and hsd.STAT_NAME='usage'
and hsd.STAT_ROLLUP_TYPE='average') as 'NetKB'
,(select SUM(hsd.STAT_VALUE)
from VPXV_HIST_STAT_MONTHLY hsd (NOLOCK)
where hsd.Entity = moid.MOID
and hsd.STAT_GROUP='cpu'
and hsd.STAT_NAME='usagemhz'
and hsd.STAT_ROLLUP_TYPE='average') as 'CPUMHz'
from vpxv_vms vms (NOLOCK)
INNER JOIN VPXV_ENTITY_MOID moid (NOLOCK) on vms.VMID=moid.ENTITYID
where vms.POWER_STATE='On'

Saturday, February 01, 2014

A weekend in Guajiquiro

Guajiquiro is a biological reserve in the mountains of Honduras. The elevation is approximately 14,000 feet (about the same as the top of Mount Rainier), and even though it is in the tropics, it is very cold.
Guajiquiro is approximately 3-4 hours out from Tegucigalpa. Not that it is exceptionally far, but the mountain roads make a slow going, and therefore it is fairly difficult to get there. In this area live a native group known as the Lencas, the same tribe that the Honduran hero Lempera was from. For those not sure where this is, check out http://goo.gl/maps/Ns7ok or the map below.

View Larger Map

The youth group at the Amor y Vida church decided to make a weekend mission trip to this area to a sister church named Iglesia Lenca de Santidad. Approximately 75 people helped out for the weekend with painting, preparing clothes, food, cleaning supplies, and visiting the homes of the people who live there to share the good news and invite the families to the church for a service and party for the kids.



Not everything was as easy as I first thought when I heard about 75 people helping out at a small church. To start with, the room we were painting was home to several wasps. We were told that because it was cold they shouldn't bother us, but we should still leave them alone.


Also, it was very cold and foggy. The high altitude meant that the thick clouds rolled in to make a very thick fog. There were several times where I was glad I was in a group with someone who knew the area just because of the fog and I could have easily gotten lost (I get lost easily)



We split into two groups: the first group painted the classroom, while the second organized all the clothes and other supplies to pass out later in the day.







When we were done, we went to the houses and got to meet the people who live there. I have been to many of the homes of people near the trash dump in Tegucigalpa, so I wasn't expecting much in way of the houses and furnishings. However I was surprised to find that many of them had even less than the kids that go to AFE.

Afterwords, we got to goof off a bit. Somehow it was decided that everyone should arm-wrestle me, I did good until my arm got tired after the fourth or fifth person.




Eventually - bed time. All the girls slept in a guest house with bunk beds, while the guys slept on the chairs or floor of the church. Apparently the girls all decided that sharing a bunk with 3 or 4 others was the perfect way to stay warm - the guys on the other hand slept mostly solo and cold.



In the morning we had a small party for the kids of the community, along with 2 pinatas. It was a scene that could have happened anywhere - kids swinging at the pinata, and as soon as they exploded the ground was swarmed by everyone trying to get at the candy.




We finished off the trip by going to a nearby waterfall. It very quickly turned into a challenge of bravery as a line of kids, and adults, walked through the freezing water. Thank goodness I had my nice shoes on and couldnt get them wet....


Looking back on the event, it was amazing not only in what we did and how it impacted the lives of those in the community, but how it impacted the lives of those who went. Students from AFE with very little to their name went to a community even poorer than themselves and saw what it means to follow Gods command to help and give to those in need. On the way back there were several people talking about how much they enjoyed the experience, and how they would like to do more. About how they might become missionaries to other communities within Honduras.

It just goes to show, God is calling all of us to do something, anything, and he equips us to do what is there. We dont have to be called specifically to be a missionary, pastor, or evangelist, even those without any experience, training, or ability can still help


Tuesday, January 21, 2014

Starting another year at AFE!

After a very nice and relaxing christmas in Washington State, Jana and I returned to Honduras last week to start our second year at AFE. The Honduras school calendar is February through November, which made the timing our first trip home perfect.

This week is teacher training and preparation and today we reviewed the 6 pillars of AFE's mission:

  • Family
  • Spiritual
  • Emotional
  • Education
  • Sexual
  • Health

These 6 pillars describe how AFE is changing the trash dump community one family at a time. Instead of simply providing education to kids, AFE is providing help for the children, their family, and their entire lives.

It struck me today as we were reviewing these tenants today that the setting had more of a bible study feel than a teacher training normally would. Here we had nearly 20 teachers gathered around tables talking eagerly about how we can use these tenants to be more than teachers. Instead, we were each discussing and sharing how we can become friends and mentors with our students at the same time as we instruct them.

Growing up in a public school, I am sure that my teachers had conferences and training sessions. In these sessions I am sure they talked about skills to be a better teacher, how to relate to your students, and how to handle various crisis. However, today we were talking about how we could better share our own lives with our students, how to share the good news with our students, how to help them not just pass a class, but to be prepared for life.

Ever since Jana and I decided to come down here to teach, I knew we were called to the kids here in the Tegucigalpa trash dump. I knew that it was our job to come here and try to share our hearts and our lives with the people here. And today I realized that every single teacher at our school feels the same way. We are an amazing team, and I am looking forward to see what God will do among us.