Getting Virtual Box Guest Additions to work on a Ubuntu (12.10) Quantal Quetzal guest

December 4th, 2012

Virtual Box Guest Additions are used on the guest OS. I needed to make Ubuntu run as a guest OS in a Virtual Box VM on a Windows 7 and therefore needed the Virtual Box Guest Additions for Ubuntu. But to get them to work on Ubuntu Quantal Quetzal, you’ll need the virtualbox guest additions 4.2.4 from http://download.virtualbox.org/virtualbox/4.2.4/VBoxGuestAdditions_4.2.4.iso.

FOSDEM 2011

January 12th, 2011

I have just planned my trip to FOSDEM 2011…

FOSDEM, the Free and Open Source Software Developers' European Meeting

Concatenation of MP4 videos using MP4Box

November 23rd, 2010

I’ve come across several posts on the Net that states that concatenation of MP4 files by means of MP4Box (from gpac) will make VLC play two videos concurrently instead of playing the videos in sequence.

I had the same problem, but once I had all the source MP4 videos generated with the exact same audio and video encoding parameters (that meant adding audio to the MP4 videos that did not have audio) things worked out fine.

Actually, I thought I had used the same parameters for all my MP4 files, but during the conversion from an AVCHD video to an MP4 by means of ffmpeg, the frame rate somehow went from 25 fps to 26.09 fps (you can check this using ffmpeg -i somevideo.mp4 on all your MP4 videos). Once I added “-r 25″ as the last option to ffmpeg, the issue was resolved.

FSCONS 2010 day 2

November 7th, 2010

The 2nd day of the FSCONS 2010 conference is now over. I particularly liked the talk “The economics of open innvation and FOSS” by Karthik Jayaraman. Very illuminating talk about thre drivers behind open innovation, the future directions, and the various business models that are viable under such conditions. Some the same was addressed in the key note speach “Ethics of Intellectual Monopolies”. The talk raised my awareness of the challenges our society are currently facing and the opportunities we stand too loose if we don’t manage to constrain or do away with the tools of intellectual properties like copyrigth and patents. Hopefully, the videos and presentations will be out soon.

Report from FSCONS 2010

November 6th, 2010

I’m at the FSCONS 2010 in Gothenburg, Sweden. Interesting talks. In particular the talk on Open Hardware Repository by Javier Serrano. Not only was his presentation on the ideas behind and experience with Open Hardware very interesting (it reaffirmed my believe that the ideas about free technology must be extended beoynd software), but he also presented a specific project; White Rabbit. Hadn’t seen it before, but it clearly seems to be interesting for distributed control and data acquisition systems.

My experience with .NET Compact Framework

October 15th, 2010

I’ve recently been working with the .NET Compact Framework 3.5 on Windows CE 6.0 for a customer of mine. The .NET Compact Framework is frequently referred to as a sub-set of the full .NET framework. In reality, there are more differences, however.

Overall, the Compact Framework seems to have been crafted with one single strategy; reduced code-/ram-consumption. The garbage collector is therefore working differently. The JIT compiler may also have to compile the same code multiple times because the result of earlier compilations may have been thrown away by the garbage collector. Also, no virtual tables are used. Virtual calls are based on a search-algorithm. Many other differences are documented in Microsoft slide show with the title “MED 301 Developing High Performance Applications with .NET Compact Framework”.

The effect is that many constructs that are acceptable in terms of performance in the full .NET are less optimal in Compact Framework. A virtual method call, for example, has a significantly higher cost (roughly a factor of 1.4) in execution time than a non-virtual call. Of course, it is not a big surprise that a virtual call has a higher cost than a non-virtual call; that’s already known from C++ and also applies to the full .NET framework. The cost is, however, higher in the compact framework.

I helped create a teaser on this while we were working on the project. It’s in danish, I’m afraid, but the solution comes with some interesting measurements that are worth looking at.

Microsoft may well be right that embedded systems typically have less memory than desktops and servers and one therefore needs to be more cautious when coding for embedded systems. But many embedded systems also have significantly less CPU power and are often powered by a battery. So the CPU cycles also matter. And as of this writing, there are no tools available to compile a .NET Compact Framework application to native code for a Windows CE 6.0 device (again, Microsoft’s argument is that the resulting code takes up more space).

If we disregard usability issues, application speed perhaps matters the least in UI-applications. Perhaps Microsoft intended to target their compact framework entirely for UI-applications?

But then, as the range of UI controls, properties, and methods available in the compact framework are far less than those in the full framework, you can only make the most simple UI’s in the compact framework, unless you write your own replacement for Windows.Forms (see e.g. Creating a Compelling UI for Windows Mobile and the Microsoft .NET Compact Framework or Building Graphically Advanced Applications with the .NET Compact Framework 3.5) – and that’s not a small amount of work.

This all makes porting of an application from the full .NET framework to the compact framework non-trivial. Personally, I also feel that the closed-source nature of the .NET framework makes it more difficult to write optimal code.

Add to this that you need both a license for Visual Studio 2005 (to build Windows CE 6.0) and Visual Studio 2008/2010 (to build the .NET application).

All-in-all, my conclusion is; think twice before you embark on the .NET Compact Framework.

Grub legacy issues with ext2 resolved

September 22nd, 2010

Back in 2006, I was playing around with buildroot on a small personal project I had. This month, I decided to return to that project again, but this time with the latest version of buildroot.

Buildroot has advanced quite a lot since 2006, but it only took little time to get the build environment running again. The only obstacle turned out to be the bootloader – Grub (Grub Legacy, that is). Grub Legacy is no longer under active development (Grub2 has taken its place), but patched versions of the latest release of Grub Legacy (0.97) are still in use; In Buildroot 2010.08 and Ubuntu 10.04, for example. Unfortunately, these versions suffer from two problems:

  1. The code relies on a manual parsing of C var_args in order not to link against the C standard library. This parsing is, however, incompatible with GCC 4.3.5. A segmentation fault therefore occurs.
  2. The code does not handle the ext2 file system correctly. A division by 0 may therefore occur.

I’ve therefore created a patch to buildroot 2010.08 and filed a bug report. The patch is attached to the bug report.

TLS client/server authentication does not prevent phishing on the Web

August 27th, 2010

Think about the following scenario:

Alice needs to upload a document with sensitive information to https://www.disk.net/. The Web server servicing this URL is run by Bob and uses TLS server and client authentication to ensure that Alice’s browser and Bob’s server can authenticate each other. Of course, both parties (client and server) need to have a certificate installed. In todays prevalent CA-based PKI, these certificates must be issued by CA’s that both entities trust. Bob’s server uses Alice’s client certificate for automatic login on Alice’s account.

Another server, run by Eve, is servicing https://www.disc.net/ and has been deliberately crafted to mimic the service at https://www.disk.net/ in order to fool people into uploading documents at the wrong service.

Eve’s server also has a certificate issued by a mutually trusted CA, and will similarly use Alice’s client certificate to do a login on a (perhaps dynamically created) account. So if Alice by mistake connects to Eve’s server instead of Bob’s server, it is likely that she will not notice her mistake.

Why doesn’t TLS in todays browsers prevent this scenario? Because

  1. todays web browsers by default accepts any server certificate issued by one of the root CA’s that they have been configured to trust. Todays browsers fully rely on CA’s to not issue certificates to servers that have been set up for phishing purposes. I doubt that todays CA’s live up to this responsibility.
  2. client certificates can in some cases actually assist Eve’s server in creating a login experience that makes Eve’s services more closely resemble those of Bob.

In other words, the problem is not in the TLS protocol or the implementation of it. Rather, the problem is in the PKI that underlies the integration of TLS in todays browsers.

Windows Device Emulator vs Windows 7 Firewall

July 17th, 2010

I could find no obvious reason why my Windows 7 firewall was blocking internet access from my Windows Device Emulator to a server application running on the host PC. So, while the Windows CE application was running on the device emulator, trying to get connected with the server application on the host PC, I turned off the firewall, and as I expected, the Windows CE application could all of the sudden connect to the server.

What surprised me a bit, however, was that turning on the firewall again, let the Windows CE application continue to connect/disconnect to the server on the host PC. Now, after each reboot of the host PC, I always start up the device emulator, let the Windows CE application try to connect, start my server, and then turn off the firewall and then on again. It works every time.

Windows 7 Home Premium to Ultimate Upgrade

June 11th, 2010

I had a Windows 7 upgrade (from Home Premium to Ultimate) forced upon me; I was working with a Microsoft Device Emulator and needed to get a .NET Compact Framework application on the emulator to access the network on my Windows 7 host. That required installation of a Virtual PC network driver. Unfortunately, Virtual PC cannot be installed on Windows 7 Home Premium, so I had to upgrade.

To make things worse, an online upgrade is not available where I live. So I had to wait for the upgrade key to be shipped to me.

And when I got the key, things only got worse: I started up Windows Anytime Upgrade and entered the key as requested, and a text kindly informed me that the upgrade would take only 10 minutes. After 1.5 hours, the upgrade was still not done, and there was no network activity, as one could have expected.

I killed the Windows Anytime Upgrade processes and started over again. Same result. Tried to kill as many processes as possible and start over again. Same result. Did a logout and login and started the upgrade once more. Same result. Then decided to restart the machine, but that only made the machine hang during shutdown. After 15 minutes, I pulled the power cord and removed the battery. When I booted the laptop again, the boot manager correctly stated that Windows had not been closed down properly, but I chose to start Windows normally anyway. Windows 7 then started a cycle of 2 or 3 restarts/reconfigurations/updates after which it finally claimed it had upgraded to Windows 7 Ultimate and let me login again.

Needless to say; Windows 7 Ultimate isn’t exactly cheap, so I had expected a smooth upgrade. The experience I had was totally not acceptable!