Apr 272013
 

If you have a powerful primary machine (for instance a Dell notebook with an Intel Core i7 processor), it can easily run several Operating Systems and user sessions in / on them side by side – virtualisation is the magic of today’s computing.

The Raspberry Pi, whilst not having enough general purpose power to do really pleasant desktop computing, can very well serve as a “window” to Windows, Linux, MacOS and other more exotic systems running elsewhere. You could run several users off a powerful server machine – all you need is some networking gear, monitors, mice, keyboards, and of course Raspberry Pis.

Your users will enjoy an absolutely silent and energy-efficient client, while the noisy server is hidden away in the basement somewhere (or is in the admin’s room).

Access Windows from the Raspberry Pi

Today we will show you how to access a virtualised Windows desktop from the Raspberry Pi.

VirtualBox

On the host computer which will run the Operating Systems and user sessions for the Raspberry Pi terminals, you should install Oracle’s VirtualBox. (If you are not a fan of Oracle, remember that this was not developed by them but by SUN, and rebranded later on).

The host computer ideally should have hardware virtualisation extensions in the processor, which will allow the guest systems to run much more fluently.

We assume that you run Windows 7+ on the host. VirtualBox also works on Linux, though.

Run VirtualBox, and set up a Windows virtual machine (how to do this is outside the scope of this document).

Networking setup

Here’s the important part to know: initially the virtual network adapters for your virtual machine are set up as “NAT” devices. To be able to access RDP and all other parts freely on your network, the network adapter should be set up as “Bridged Adapter”.

image

This will connect it directly to your network – the machine will be seen outside of the host computer. If you have a DHCP server running, Windows by default will fetch it’s IP address from the DHCP server (e.g. your router).

To be able to access the virtual machine without looking up it’s address first, we recommend to assign a static IP for it ( outside of the area your DHCP server uses to assign IPs).

This is done by right-clicking on the network adapter in Windows, bringing up it’s properties, and editing the IPv4 properties. Whilst being mostly outside of the scope of this short how-to, I’ll share a screenshot with you, which should help you:

image

adjust your settings accordingly.

Note:

The current IP address of your windows computer can be determined by hitting the Windows key, writing “cmd”, pressing Enter (to bring up the command line), and the following command:

ipconfig

image

 

RDP Setup

This part can also be applied to physical machines running Windows.

To allow remote connections to your Windows machine, you have to enable RDP connections first. This is done by hitting the Windows menu, right-clicking on “Computer”, selecting the entry “Properties”.

In Windows 7, you have to click on “Remote settings” in the sidebar of the window which you will see. The dialogue which comes up, will allow you to configure RDP settings.

image

Select “allow connections from computers running any version of Remote Desktop (less secure)”. Click “OK”.

Creating new user

If you do not have a password protected user in your virtual Windows installation yet, you should set one up. You can either create an admin user or a regular Windows user. Using these credentials you will be able to connect to the machine later on. Of course you can also create a new password for the user you already have, if you have decided not to use a password initially.

Raspberry Pi

Start an X session:

startx

Launch the root shell (start menu > Other > X-Terminal as root (GKsu).

Update apt package cache (if you don’t have aptitude, use apt-get):

aptitude update

Install rdesktop package

aptitude install rdesktop

After rdesktop is installed, it is literally just one short command to connect to your virtual Windows desktop:

rdesktop 192.168.1.3

Just replace the IP address with the IP address of your Windows virtual box.

Rdesktop will start a window and allow you to log in to your Windows virtual box. You can click on “Other user” and insert your login credentials here. If another user is logged in at the main machine / via another terminal, Windows might request you to wait for 30 seconds so the other user might allow or disallow your connection.

If you want to launch a full-screen session, you can use the –f switch

rdesktop -f  192.168.1.3

Forwarding sound of the Windows machine to the Raspberry is also possible. Unfortunately it will sound horrible (choppy / barely understandable) – I am not sure what the reason is, as the Raspberry Pi processor is not maxed out (e.g. when streaming Web radio). The sound will sound the same over HDMI and analog output (tested today).

rdesktop -r sound=local 192.168.1.3

Some further options will improve your experience:

rdesktop -z -x lan -P 192.168.1.3

These switches have the following meaning:

-z: enable compression

-x lan: set experience to “LAN” (will show desktop wallpaper, windows while moving them etc.)

-P: enable caching to disk (i.e. the Raspberry Pi’s disk)

Some screenshots

rdesktop-on-raspberry-pi

 

libreoffice-rdesktop-raspberry

Experience

YouTube

YouTube will run, but very choppy – it will max out the Raspberry Pi’s processor. (This is a software problem – rdesktop is probably not using the efficient GPU of the Pi for processing). Sound quality is horrible, actually you can’t really understand it – it’s all chopped up. Sound quality will improve if you minimize YouTube (thereby limiting screen updates which are required, and lowering the load on the Raspberry processor). Sound will still sound choppy, though. All in all not good enough right now.

Sound

As mentioned above, sound quality (if forwarding sound) will be nearly unbearable. Maybe there are some better solutions (i.e. combining a sound streaming server which captures the sound and plays it back on the Pi).

The sound unfortunately will not improve if setting the Group Policy, and forcing sound quality to “high” on Windows. (use gpedit.msc)

Update

The sound problems seem to occur from buffer underruns on the Raspberry Pi side. (see below, xfreerdp).

Desktop experience

Especially with the optimised parameters (-z –x lan –P) the experience is really smooth. For word processing, spreadsheets and web browsing, you will be pleasantly surprised by the reaction speed.

Drawing & photo manipulation will be doable, but in a test with Paint, there was some slugginess.

Actually I see a huge potential in classical desktop / web application workspaces – where you don’t need multimedia, i.e. in a call center where people use web forms and interfaces to access your account with the company.

xfreerdp

xfreerdp is an alternative RDP client. You can install it using

aptitude install freerdp

And use it

xfreerdp -u Wanda -x l -z --plugin rdpsnd --data alsa -- 192.168.1.3

Please note the “x” in front of freerdp here.

This will connect with the user “Wanda”, enable LAN experience, enable compression (-z), and activate sound forwarding through the rdpsnd plugin. The two double dashes after “alsa” and before the IP of the host virtual machine ARE necessary.

Sound will still sound horrible – it will spew out a lot of “underrun occurred” messages on the console. We have tested different options to decrease load, increase latency, use the tsmf option, etc – nothing changed the horrible quality. Right now, the verdict stays the same: great for desktop computing, but not at all for multimedia applications.

There may be some improvement with the current GIT version of freerdp. We have not tested it yet.

Jan 142013
 

… which are not encoded. That (sadly) rules out commercial discs … at the moment – a solution should be available soon. But – the power to play BluRay is there. Read on for a how-to and for a test ISO you can test your Pi with.

Blu-ray_disc_(BD-RE)

How-To

  • We used our BluRay burner to burn a BluRay ISO with unencoded content (see below for more information about it)
  • To play the disc we used (the newest) BerryBoot with OpenELEC. Other distributions, like Raspbmc may also work – we’re interested in your feedback!
  • And an external powered USB Hub (important!) to provide sufficient power to the BluRay burner
  • Of course we use only 512 MB Raspberry Pi’s for our tests. The same ones you can buy from our shop.
  • BluRay decoding needs VC-1 and MPEG-2 codecs (both are in the standard). You can buy a codec package for the Raspberry Pi from our store. Please note, that the disc we have tested with could work without the codecs, as it is being encoded to MPEG-4 (which is available in hardware by default).
  • For good performance it is important to give the GPU more RAM. Else you may see buffer underruns and sluggish playback. We saw good results with a memory split of 256 MB / 256 MB:

Add to your config.txt:

gpu_mem=256

  • The title content may playback when you press the “Play Disc” menu entry
  • OpenELEC does not support the BluRay menus on the Raspberry Pi (yet). Thus, you will need to play the other titles on the disc manually.
    • Enter the Videos -> Files menu, select the BluRay (i.e. “x264 Demo Blu-Ray”),
    • Select the “BDMV” folder
    • Select “STREAM”
    • Here are the BluRay’s Video Streams. Open and play by doubleclicking.

Our test BluRay

A developer working on x264 (a free encoder to encode content into MPEG-4 AVC), has released a BluRay image containing open material (Big Buck Bunny, Elephants Dream, and live action footage by Microsoft). This image is a bit over 2 GB in size, and can also be burned to a blank DVD disc. If burned to DVD, most BluRay players should still recognize it as BluRay (because of the special format). We have used a blanc BluRay to burn to, and test with.

Click here for the full article.

Download ~ 2 GB (Torrent – you need a Torrent client to download this!)

Q&A

Is USB 2.0 fast enough for BluRay playback?

USB 2.0 has a data rate of 480 MBit/s. The content stream of a BluRay, including all camera perspectives and audio tracks is limited to a data rate of 54 Mbit/s, or “1,6 x speed” – which has to be supported by all BluRay video playback hardware.

“1 x speed” equals a data rate of 36 Mbit/s. 6 x speed (the max. speed our BluRay writer can read) equals 216 Mbit/s. Thus USB 2.0 has more than ample resources to handle BluRay playback and burning, even if you consider protocol overhead and other devices on the same bus (i.e. the LAN of the Raspberry Pi).

Will I be able to play my commercially bought BluRay movies on the Raspberry Pi?

Not directly. The movies are encoded, and the keys are available to certified software / hardware vendors only. Even if the keys were known (some of them are), the ARM processor of the Raspberry would need to decode the stream. I am currently not sure, whether it is “fast enough” to do it. (the video is decoded in hardware, but maybe the Broadcom SoC also has some BluRay decoding capabilities?)

There are reports of software which allows you to back up your BluRay Discs. These backed up files should play on the Pi, although we have not tested that yet. Have a look at this guide.

Does OpenELEC support the BluRay audio formats?

We have the following codecs working:

  • DTS  HD Master Audio
  • Dolby Digital

which is used on over 50 % of BluRays, according to Wikipedia. We still have to test the other codecs.

Optimization WordPress Plugins & Solutions by W3 EDGE