Much ado about scripting, Linux & Eclipse: card subject to change
2020-01-14
Force Chrome to use hardware acceleration (performance enhancement under virtual box 6)
In: chrome, chrome79, fedora, fedora31, virtualbox, virtualbox61
2009-08-06
Hudson & Virtual Box, Part 2: Creating a common share with vboxsf
My experiment last week with sshfs came to a grinding halt when I realized that while the share works, and can be automatically started, the permissions do not work and Hudson can't actually use the sshfs share; also, I couldn't get sshfs to compile for OpenSolaris, so it's really a non-starter.
Next up was mount_nfs
, but after fighting with that, /etc/nfs.conf
and /etc/exports
for a couple days off and on, I realized there's a much simpler solution using Virtual Box itself: vboxsf
. Note that it's sf (shared folder) not fs (file system).
Thanks to David Herron for the inspiration.
Here's how to set up a vboxfs share:
- Ignore the Virtual Box wiki which suggests that you can't just use a Shared Folder: you can.
- Guest: Launch your guest, then install the Virtual Box Guest Additions onto it.
- Host: Create a user and set its uid and gid to some value which can be created on the guest / slave. For example, on Mac OSX 10.5 Server, launch
System Preferences > System > Accounts
, and create a "hudsonbuild" user with User ID and Group ID set to 500.Note that uid 500 and gid 500 are the defaults for the first user on a Fedora system; on Ubuntu it's 1000; on other systems YMMV.
- Host: Create a folder in the root of your host called
/shared
. Put some files there. Give it full write permissions, and set its ownership to the user who'll be sharing the files:find /shared -type f -exec chmod 666 \; find /shared -type d -exec chmod 777 \; chown -R 500:500 /shared
- Host: Add a Shared Folder. NOTE: If your guest is running, shut it down or see the next item. From the Virtual Box GUI (on the host), select
Settings > Shared Folders > New (+)
. Add a shared folder called "shared" mapped to/shared
(or call it something else and map it to a different path on your host). - Guest: Alternatively, you can add a Shared Folder to a running guest from its
Devices
menu. Add a shared folder called "shared" mapped to/shared
. - Guest: As root, create a folder on the guest called /shared. Leave it empty, but make sure it's owned by your user.
- Guest: As root, add this to the guest's /etc/fstab:
shared /shared vboxsf auto,exec,rw,uid=500,gid=500 0 0
- Guest: As root, mount the share one of three ways:
# mount everything in /etc/fstab mount -a # mount using mount (and optional -o options) mount -t vboxfs -o auto,exec,rw,uid=500,gid=500 shared /shared # mount using mount.vboxsf (and optional -w and -o options) /sbin/mount.vboxsf -w -o rw,uid=500,gid=500 shared /shared
- Guest: If this mount doesn't start automatically when the VirtualBox guest is started, you can add one of the above commands to the script you use to start the Hudson slave, eg:
!/bin/bash # # Init file for Hudson server daemon # # chkconfig: 2345 65 15 # description: Hudson server # HOWTO: # 1. rename this file on target server (Hudson slave node) to /etc/init.d/hudson # 2. to enable this script to run on startup, as root type the following: # Fedora: # chkconfig --add hudson; chkconfig --list hudson # OpenSolaris: # for n in 0 1 6; do cd /etc/rc${n}.d; ln -s /etc/init.d/hudson K15hudson; done # for n in 2 3 4 5; do cd /etc/rc${n}.d; ln -s /etc/init.d/hudson S65hudson; done # svccfg add hudson; svcs | grep hudson RETVAL=0 #run Hudson as a slave node java -jar /opt/hudson/slave.jar -jnlpUrl \ http://vboxsvr:8080/computer/${slaveNodeName}/slave-agent.jnlp & /sbin/mount.vboxsf -w shared /shared & exit $RETVAL
2009-07-28
Hudson & Virtual Box: Creating a common share with SSHFS
I've been working a recently with my own Hudson server, setting up Fedora and OpenSolaris images as slave nodes to prototype new ways to build. Tonight I found a very handy trick for mounting shared drives using SSHFS. Kudos to the man page writers -- all the tips I found via Google were outdated or just plain wrong. man sshfs
to the rescue!
Step 1: create a folder on the Hudson master / Virtual Box host with files you want to share, eg., /shared
Step 2: create an empty folder on each Hudson slave / Virtual Box guest as a mount point for the shared folder, eg., /shared
Step 3: on the guest, install sshfs, eg., sudo yum install fuse-sshfs
.
Step 4: mount the share: sshfs user@hudson-master-host.your-domain.com:
/shared
/shared
Of course you'll probably want to set up ssh keys and add this to your startup scripts so that the mount happens automatically when the guest is launched, but I'll leave that for next time.
2009-07-06
Learning to Love the Mac: 13 Tips
A month ago a very large package arrived in the mail: my first MacPro server. I at once fell in love with the case design - clean, simple, and dead-easy to take apart in order to add more drives and RAM. However, that's where the love boat ran aground.
To say it's been a gradual learning curve would be an understatement. Here are a few things I've learned over the past month of dealing with Mac hardware and OS, as well as retraining my fingers to use Mac keyboard bindings (META = Apple Key or Windows Key, depending on your keyboard).
- Use META-TAB instead of ALT-TAB to cycle applications
- Use META-LEFT/RIGHT instead of HOME/END to jump to start/end of a line
- Use ALT-LEFT/RIGHT instead of CTRL-LEFT/RIGHT to jump to prev/next word on a line
- META-A, META-X, META-C, META-V replace CTRL-A, CTRL-X, CTRL-C, CTRL-V for select all, cut, copy, & paste. META-L, META-T, META-N replace CTRL-L, CTRL-T, CTRL-N (jump to location bar, new tab, new window). But CTRL-TAB still switches tabs. However, if you have multiple Firefox windows open, there is no way to toggle between them with the keyboard. Same problem with multiple Terminal windows. META-TAB only switches between groups of applications, but not windows within an application.
- Sometimes ESC works to dispose a dialog; sometimes only clicking the red X works.
- Q replaces qemu, but doesn't seem to work very well for my existing vmware or Virtual Box images
- Virtual Box rocks on Windows, Linux and Mac
- XCode provides gcc, make, etc.
- Fink and DarwinPorts replace Debian/Ubuntu's
apt-get
and Gentoo'semerge
, respectively. Once XCode and DarwinPorts are installed, you canport install vpnc
(to fetch deps and compile on the fly) orapt-get install curl
(to fetch deps and install). - rEFIt replaces grub, and more or less works as I'd expect.
/efi/refit/refit.conf
approximately replaces/boot/grub/menu.lst
at least as far as picking what partition to default-boot and how long to wait - Java is in
/System/Library/Frameworks/JavaVM.framework/Home
instead of/opt/
or/usr/lib/jvm/java
- Subversion was easier to set up on Mac (using Fink) than on Fedora 10 (using yum), especially since there's now the Galileo+ Update Site from Cloudsmith so you don't have to download from multiple update sites to get it installed.
However, the version of Subversion available via Fink doesn't work with projects checked out using Eclipse - seems that the commandline client (Subversion 1.4.4) and Subversive with SVNKit (SVN 1.6.1 w/ SVNKit 1.3.0.beta.r5741) are not compatible:
svn: This client is too old to work with working copy '.'; please get a newer Subversion client
. Using DarwinPorts to update the subversive client to 1.6.3 fixed this issue, but installed it into a different path (/opt/local/bin
instead of/sw/bin
or/usr/bin
). - Eclipse looks better on Mac than on Linux; however, I recently stumbled across a great tip for making Eclipse waste less screen space under gtk on Linux. Highly recommended bit of gtk hackery - one file makes a world of difference!
In: darwinports, debian, efi, fink, keybindings, linux, mac, macpro, osx, refit, subversion, subversive, ubuntu, virtual, virtualbox, xcode
2009-01-29
HOWTO Create a Seam Web Project with JBoss Tools 2.0.0.CR2 or Developer Studio 3.0.0.CR2
As Max announced earlier today, JBoss Tools (JBT) 3.0.0.CR2 is now available.
In my continuing effort to automate - or at least document! - everything I do, here's a quick slideshow showing how to install and run JBoss Developer Studio (JBDS) 2.0.0.CR2 to quickly create a Seam Web Project. JBDS includes most of JBT, plus a few extra goodies.
What else can you do with JBoss Developer Studio or JBoss Tools? Lots. Here's a list of the individual plugins, and the reference guides. There's even a jBPM/BPMN diagram editor, which I used recently to sketch out my Blackberry data sync flows:
JBDS is available for Linux (gtk x86_32 and x86_64), Mac OS X (carbon), and Windows (32-bit). JBT is available for any platform that can run Eclipse 3.4.x. On Fedora, JBDS and JBT both run great with IcedTea (OpenJDK 6) and Fedora Eclipse 3.4.1.
If you're curious, the software involved here is: Virtual Box 2.1.0 running in Fedora 10, hosting a Windows XP Home guest, HyperSnap 6 to grab snapshots (works in Windows guest and through WINE - though not as well - in Linux host), Sun Java 6.0 to run JBDS (or Eclipse + JBoss Tools), Picasa 3 For Linux to crop, resize and upload images, then create the slideshow.
2009-01-03
Blackberry Linux Calendar & Contact Sync
Ugh, what a nightmare. Skip to solution. See also Part 2.
PocketMac for Blackberry, Linux Edition
Unfortunately, I missed the deadline to be a beta tester for this new app. Comes highly recommended by a Macolyte friend of mine; unfortunately until it's released I won't be able to come anywhere near it. :(Blackberry Desktop Manager in VirtualBox
First, I tried to install Blackberry Desktop Manager into a VirtualBox 2.1 Win XP Home guest OS, running on xubuntu 8.04. Problem there was that OOTB the VB guest couldn't see my USB devices (ie., the mounted Blackberry). Solved [1], [2].Unfortunately, while the Windows guest could see the Blackberry, it couldn't sync with it. I keep getting prompted for my password to enter "mass storage mode", then ultimately the backup failed, as the connection was dropped midway through.
Hoping that the story would be better on my newer x200 Thinkpad, I tried again -- same result. Additionally, though the VirtualBox Windows guest found my bluetooth adapter, I couldn't make it work under Windows to connect to the BB.
barry
I tried installing barry, the Blackberry Desktop For Linux project. I installed 0.14-4.fc10 and 0.14-6.fc11, but it didn't work - perhaps the Bold is too new?
(-1, error sending control message: Operation not permitted): Probe: GetConfiguration failed
So, for now, the only way to backup/restore is via my wife's WinXP laptop.
UPDATE, 2009/01/05: Turns out you have to run barry w/ root privileges. I can now backup on linux. W00t!
But surely there's another way to sync?
OpenSync
Next, I tried OpenSync. This didn't work either. I tried 0.22 on xubuntu 8.04, with KitchenSync 0.1, but it couldn't connect to the device. Then I tried 0.36 on the x200 Fedora 10 box with msynctool, but it too couldn't connect to the device (even though I'd already paired the BB with the Thinkpad over bluetooth), perhaps because my settings were incorrect? Either way, both front ends left a lot to be desired for a total noob user. XML config files are fine, but better in-file documentation would be nice.msynctool msynctool --listplugins msynctool --addgroup BB msynctool --enable-objtype BB syncml-obex-client msynctool --addmember BB syncml-obex-client msynctool --enable-objtype BB google-calendar msynctool --addmember BB google-calendar msynctool --enable-objtype BB file-sync msynctool --addmember BB file-sync msynctool --showgroup BB msynctool --configure BB 1 msynctool --configure BB 2 msynctool --configure BB 3 msynctool --sync BB ... still failed to connect to device :(
Funambol
Then I discovered the Funambol web-based sync option, and signed up. This worked, and I now have my contacts and BB calendar synched with their server. OK, that's great, but what I really wanted was to sync w/ my desktop apps and/or with Google Calendar. So, I tried the Funambol Mozilla Plugin 0.8 for synching contacts and calendar with Sunbird 0.9 (or Thunderbird 2.0 with Lightning 0.9). It worked on my home xubuntu 8.04 machine (one email address, no calendars) but failed to install on my work Fedora 10 machine (two email addresses, two calendars, RSS feeds & newgroup subscriptions).UPDATE, 2009/01/05: My Thunderbird profile had been corrupted. Creating a new one, importing from the old one, and reinstalling all extensions fixed this problem. But because I can use Google Sync for Contacts and Calendar, I'm only using Funambol for Tasks now. Details here.
Google Sync
Finally, checking my Google Calendar online I noticed a new "Sync" link in the top right. I found that Google has released an early Xmas present: Google Sync for your BlackBerry. Finally, a solution!BBToday
If you would like to have a snapshot of your mail, calendar, tasks, calls and optionally, battery status & weather in one convenient portal page, try BBToday 1.6.UPDATE, 2009/01/29: I've found a better Today screen, but it's not free. BOLD CrossBar Plus Xtreme - BOLD OS 4.6 by JC Designs / Gadgetbean. Combine this with WeatherEye from The Weather Network, and you've got weather, mail, messages, calendar... all on one attractive screen! Best. Seven Bucks. Ever.
Continued in Part 2...
2008-09-14
Windows XP in Xubuntu with VirtualBox: Aw, snap!
This weekend, on a tip from CDT Doug, I decided to play around with VirtualBox, because there's still a few things I can't do in Linux. I've tried VMware in the past, but the last time I found NAT networking to be a pain to set up. By contrast, VirtualBox is great for drivers and hardware, but getting file sharing to work took some effort. Just make sure you install the VirtualBox Guest Additions into your guest OS, and you'll have video, sound, usb, networking, and sharing.
So, what prompted this? Well...
- I can load pages in IE6 or IE7, thanks to WINE and great work of the IESs 4 Linux project... but support for IE7 is still beta, and it's a little slow.
- I can run Picasa, also thanks to WINE. The latest version even works properly with Picasa Web Albums and Blogger.
- I can open and edit MS Office docs, thanks to OpenOffice (or Google Docs).
But...
- I can't run Quicken or QuickTax (ranked bronze or garbage by WineHQ's AppDB).
- I can't run iTunes.
- I can't run Google Chrome.
- I can't run SBCG4AP, or any Windows-only games from Popcap or Gamehouse.
So, it was time to get virtual. I created an 8Gb Win XP Home image, with 192Mb of RAM, running inside my 1.6Ghz, 1.25Gb RAM Thinkpad R51 Xubuntu laptop, and it works great. I can run Chrome, iTunes, Quicken, and at least one GameHouse game. Note that in this screenshot (top right corner), the CPU has clocked itself down to a whopping 600MHz using kpowersave's Powersave scheme and Dynamic CPU policy. You'll also notice I changed the default 'Right Control Key' mouse/keyboard grab toggle to 'Left Windows Key' because that way I don't have to use my right hand to switch from the main desktop to the virtual one.
Unfortunately, SBCG4AP won't start due to this error:
When trying to get a copy of the Win XP Power Toys Tweak UI control panel applet, I managed to kill Chrome, and got this for my collection.
Finally, let me show one last feature of VirtualBox: "seamless mode". With this enabled, you can blend XP apps right into your linux desktop. They're still managed by the Windows Start menu (which I've set to auto-hide in the shot below), and tend to force themselves to be above other linux-managed windows, but it provides an uncluttered way to work, if you prefer it.