Sun’s VirtualBox 3.1.x: Getting VRDP (remote desktop) to authenticate properly with Linux PAM

I rebuilt an Ubuntu 9.10 server this past week, ripping off VMware and replacing it with VirtualBox 3.1.2. Setting up VirtualBox as a headless server was very easy with VBoxTool. However, I ran into a problem that I was unable to connect using remote desktop (rdesktop) as any user but the user that started the virtual machine.

Jan 21 22:43:13 vm-holder unix_chkpwd[16040]: check pass; user unknown
Jan 21 22:43:13 vm-holder unix_chkpwd[16040]: password check failed for user (jason)
Jan 21 22:43:13 vm-holder VBoxHeadless: pam_unix(vrdpauth:auth): authentication failure; logname=virtualbox uid=1001 euid=1001 tty= ruser= rhost=  user=jason

This is, currently, an undocumented security feature of VirtualBox 3.1x to prevent just anyone from accessing the virtual machine console. For most folk, this might be a very good thing but if you have a team of sysadmins that should have access to the virtual machine consoles, you probably don’t want them to use the same login.

If that is the case, you can add the user(s) that should have access the virtual machine console to the shadow group on the host Linux machine. Be warned though that the user(s) that are added to the shadow group should not be able to log into the host machine else they will be able to read the shadow file where all the passwords to the box are stored. If the users need access to the host box, then they should have a login for host access (not part of the shadow group) and another for virtual machine console access.

Adding linux user jason_vrdp to the shadow group:

(root) # usermod -G shadow,virtualbox jason_vrdp

Prevent jason_vrdp from logging in to the host or anyone from sudo’ing to it:

(root) # usermod --shell /bin/false jason_vrdp

That’s it 🙂

Share Button

Asher & Miriam sing along

Yeah, it’s Who Better Than Me by Phil Collins with the Turk and Tarzan names changed but it covers just about any two closely aged siblings IMHO:

Miriam
You’re one of a kind, I can’t explain it.
You’re kind of cool, in a wonderful way.
Though you’re weird, you can make it.
And who better than me to teach you.
Who better then me to set you on your way. (Mhm)

This could take some hangin’ in there
Though with persuasion I can take you on up
Make you grow up, beside the others
And who better than me to lead you
Who better than me to take you all the way (Hey hey hey yeah)

Asher & Miriam
Struggling along for years and years

Miriam
Until I came along for you
Now its all comin’ together

Asher & Miriam
And together will see this through
You for me and me for you


Asher
I can learn, I can listen
I know there’s something
Deep inside but
I need assistance to go the distance

Miriam
And who better than me

Asher
To teach me

Miriam
Who better than me

Asher
To tell me all you know

Miriam

Who better than me

Asher
You reach me

Miriam
Who better than me

Asher & Miriam
To show them all we know!

Share Button

Started reading “Foundations of Qt Development”

When I purchased Foundations of Qt Development (Expert’s Voice in Open Source) by Johan Thelin a few months back, I hoped to get to it right away but work and life diverted my attention. Today at lunch I dived into it. Even though I’m still going through chapter 1, I think I can give a hint of it:

Foundations of Qt® Development (Expert’s Voice in Open Source) is well written. He assumes that you have a little bit of C++ knowledge, avoiding into the trap that so many other authors do. You wouldn’t believe how many technical books I have where the first half or more of the book is simply a rehash of the basics. Forget that!

What I really like is that when he shows you an example of code, he explains why you would want to write it this way and how it differs from the Standard Template Language (STL – see C++ Programming Language, The (3rd Edition)). Where there are performance gains or penalties of using Qt instead of STL, he demonstrates it.

I never realized just how easy it is to write C++ using the Qt framework! Just the Signals and Slots alone make it very very powerful and that’s just the beginning. I’m completely blown away 🙂

Share Button

My wife bought a new Sony MEX-BT2700 car radio for my Saturn 2000 SL2 car but it took me 2 1/2 hours to install the thing

When my bought the Sony MEXBT2700 CD Receiver with Bluetooth Hands-Free with Integrated Microphone (Black), I was thrilled. It seems to be a nice little radio with bluetooth and all the whiz bang that I needed.

We purchased the wiring adapter and the harness so that it fits well and looks nice in my Saturn 2000 SL2 sedan for an extra $44. Not bad. The problem was that while the colored wiring diagram provided by the adapter was correct, it had me put the power wire from the ignition in the wrong pin slot as the casing was reversed! Argh! It needed to go into pin 6 but it was on the wrong side. I figured it out after taking a good look at the plug on the old stock radio.

No, I couldn’t find my multimeter which is in a box somewhere in the house. head*desk

Once I moved the wire to the correct pin hole, the radio came alive.

Lesson learned when installing a car radio: make sure you have your multimeter (or some other way of determining if the power pin is hot).

Share Button

How to resize a Gdk.Pixbuf to the size of a Gtk.Image visible area

I wrote a simple image viewer that will load a photo image into a Gtk.Image widget using a Gdk.Pixbuf.  I then added a tool bar with four clickable icons.  Zoom out, zoom in, fit to window and original size.

All but the fit to window worked well.  When I pulled the width and height from image1.GetSizeRequest(out width, out height), width & height were returned as -1.  Not helpful.  Google didn’t give me many clues either 🙁

What I needed was something that would provide the visible area of the Gdk.Image widget:

In order to get the visible area, we need to:

  • upcast Gtk.Image to a Gtk.GdkWindow
  • retrieve a Gdk.Region from the VisibleRegion method
  • retrieve the first Gdk.Rectangle from the array returned from the visibleRegion.GetRectangles method
  • extract the Height and Width from the Gdk.Rectangle

Now that we have the height and the width of the visible area of the Gtk.Image widget, we need to scale the image (Gdk.Pixbuf) while keeping the aspect. Assigning the image to the Gtk.Image widget will automatically redraw itself.

protected virtual void zoomToWindow (object sender, System.EventArgs e)
{
   if (image1.Pixbuf != null) {
     int new_width, new_height;
     int height = image1.Pixbuf.Height;
     int width = image1.Pixbuf.Width;

     Gdk.Region visibleRegion = image1.GdkWindow.VisibleRegion;
     Gdk.Rectangle rectangle = visibleRegion.GetRectangles()[0];
     new_height = rectangle.Height;
     new_width = rectangle.Width;
     scaleImage(height, width, ref new_height, ref new_width, 0);
     image1.Pixbuf = pictureBuf.ScaleSimple(new_width, new_height, Gdk.InterpType.Bilinear);
   }
}

There we go 🙂
While the code above is C#, the same principle goes for any language that uses Gtk.

Share Button

For those of you on Facebook and are interested in PowerBuilder….

Subject: Old PowerBuilder Facebook page deactivated



PowerBuilder Fan Page
PowerBuilder Fan Page
Hi Everyone, Happy new year! As of today, the old PowerBuilder facebook page is deactivated. Please be sure to become a fan of PowerBuilder here: http://www.facebook.com/pages/PowerBuilder/160355699256 Go PB!!
Share Button