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: check pass; user unknown
Jan 21 22:43:13 vm-holder unix_chkpwd: 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:
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
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 🙂
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).
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.