Tag: VirtualBox

Printing to PDF from any Application

Something I do a lot of is printing to PDF. With LibreOffice (the OpenOffice.org variant bundled with Ubuntu 11.04) you can export to PDF very easily. There is a PDF icon right there on the toolbar. You can also access the PDF functions through the File > Export as PDF option, which allows you to have a greater degree of control over the PDF that is created – such as password-protecting it. but what about other applications that do not support the creation of PDF documents?

Back in the Windows world I had installed PrimoPDF. This appeared to Windows as though it were a printer. It was a sort of virtual printer. There was no hardware of course, but the PrimoPDF entry used to show up in the print dialogs of any application that could print. If I wanted to create a PDF instead of a hard copy I selected the PrimoPDF ‘printer’ as the output device and a PDF was created for me.

I missed this facility in Ubuntu, so I set about finding out if a similar set-up could be created. Needless to say it could, and very easily.

I should say at this point that I tried this in my Ubuntu Sandbox (a VirtualBox virtual PC running Ubuntu that I use for testing) and it behaved slightly differently than it did on my actual physical Ubuntu box. It worked in both cases, but on my real PC I had to perform a few more steps.

The first thing to do is open the Ubuntu Software Centre and search for cups-pdf. When it is located, highlight it and then click the Install button.

Ubuntu Software Centre with cups-pdf highlighted
Ubuntu Software Centre with cups-pdf highlighted

The PDF output from this will go into folder called PDF in your home folder. Check, and if there is no such folder go ahead and create one. You can do this at the command line with:

cd ~
mkdir PDF

You could of course use Nautilus if you prefer. But make sure that you have a folder of that name (in upper-case) in your home folder – not in some sub-folder. In my Sandbox virtual PC, that was all I had to do. There was a new printer entry in the System Settings printer list. On my physical PC however I had to go into System Settings > Printing and then click the green Add a Printer button. I selected CUPS-PDF at each stage of the wizard and that was that.

New PDF printer
New PDF printer

It asked me if I wanted to print a test page so I chose yes. A second later a new PDF was created in the PDF folder. Double-clicking on that caused Evince, the default PDF viewer, to open it.  And there was the test page in all its glory.

Ubuntu Test Page in Evince
Ubuntu Test Page in Evince
Tags : , , , ,

VirtualBox GuestAdditions

In order to get a tighter integration with the host OS you need to install the VirtualBox GuestAdditions in the VirtualBox guest OS.

This allows you to stretch the virtual computer window to an arbitrary size and have the contents scale accordingly, and it allows you to run it in a true full-screen mode. In full-screen mode the guest virtual computer takes over all of the screen. The edges of the window in which it is running are removed so that the display is exactly as if you were sitting at a (for example) Windows XP computer, instead of (for example) an Ubuntu one. You can even run the guest OS in a seamless mode, where the guest applications appear to run on the host desktop.

Installing the GuestAdditions also allows integration to shared folders on the Host OS.

To install the GuestAdditions  select the Install GuestAdditions option from the Devices menu in the guest OS.

GuestAdditions Devices Menu
GuestAdditions Devices Menu
Tags :

Running Windows and other OSes in Ubuntu

VirtualBox is free and can be obtained through the Ubuntu Software Centre. It allows you to create virtual computers by installing an operating system into a virtual guest computer. The guest PC runs just like a window on your physical computer’s desktop (known as the host). The guest operating system and any applications on it behave just like they would if they had been installed on a hardware computer, not a virtual one.

Here is my Ubuntu desktop with a Windows XP VirtualBox running. I’ve reduced the Windows virtual computer so that you can see it is running on an Ubuntu host. If I hadn’t then it would be identical to any ‘genuine’ screen shot of a Windows XP desktop, and you’d’ve had to take my word for it. But you can run the guest virtual computer full-screen too, if you wish.

Windows XP in VirtualBox on Ubuntu Computer
Windows XP in VirtualBox on Ubuntu Computer

VirtualBox has a facility that allows you to take snapshots of the Virtual computer. A snapshot saves the state of the guest computer completely. You can revert to a previous snapshot at any time in seconds. So if you (or some errant software) do something to your guest computer that you regret, rolling it back to a previous state is easy.

And you can do more than just roll backwards. You can choose to roll forwards to a later snapshot too. This allows you to move forwards and backwards in time, relative to the state of the guest computer, just as long as you have been making snapshots.

This solves the issue of running those few Windows applications I still need to use. I just run them in Windows! But it isn’t just Windows you can run in a virtual computer – it can be any OS.

Here is a screen shot of my desktop with three virtual computers running. I’d better point out that to do something like this you need a fast PC and plenty of RAM – the more the better – but if your PC can cope, then there is nothing to stop you running a whole bunch of different guest PCs at once.

Windows XP, Xubuntu and Mint Virtual Computers
Windows XP, Xubuntu and Mint Virtual Computers running on an Ubuntu Computer

They can be set up to be isolated and invisible to one another or they can be be bridged so that they can see one another in a virtual network. They can also be set up to have access (or not, if you prefer) to resources on the host computer such as USB devices, CD drives and shared folders.

I have an Ubuntu virtual machine that I use as a sandbox or test bed. I can install software on it and perform updates to it with impunity. If it all goes wrong then I just revert to a previous snapshot. And my physical PC is untouched.

You can also get VirtualBox for Windows and Mac computers too. So anyone can create a virtual Ubuntu computer and have a play with Ubuntu without any risk.

Tags :

Those Lingering Windows Applications

Ubuntu comes pre-loaded with a lot of software. A LOT of software. As of June 2011 the Ubuntu Software Centre lists 35,920 applications available for free download. Think of it as a sort of AppStore or Android Market, but instead of downloading mini-apps for your hand-held device these are fully-fledged desktop applications for your PC. All 35,920 of them are just a couple of clicks away.

This is fantastic.

But there are Windows programs for which there are no Linux equivalents – nor will there ever be. For example, software that accompanies pieces of hardware, such as the Update Manager software for my Garmin SatNav. I had downloaded and made good use of the Garmin Point of Interest Loader too, back in the Windows world. Is it even conceivable, in your wildest dreams, that these will be ported to Linux? No, not in the slightest. Deal with it.

OK, so, what to do? How do we deal with it?

There are several options. One is to make use of an on-going and mature initiative called Wine. The idea is that Wine provides a background framework for Windows applications to run in Linux. They have an impressive database of applications that they have successfully managed to run under Linux, including big-name graphics heavy games. At the time of writing it lists 16801 compatible applications. The application you want might well be sported by Wine.

Another option is the Internet. Sticking with the SatNav example, I used to use the fabulous and free Point of Interest Editor to edit POI files. I would later load these into the Garmin and my own data points would be shown on the map, and could be navigated to. Necessity being the mother of Googling, I searched and found that there are free sites that offer the same functionality as the POI desktop applications. As a bonus they store a copy of your files in the cloud, providing a safe haven for your data. So if you can’t get a Linux application to do what you want there might well be a web-based solution you can use. I found all I need (as far as POI editing goes) at the aptly named POI Editor site – and it’s free.

A third option is VirtualBox. That topic deserves a post all of its own.

Tags : ,