Você está na página 1de 10

prtfl.

io

http://www.prtfl.io/muellerwolfram/blog/2013/1/23/how-to-use-photo...

Wolfram Mller
About Blog Projects Resume Contact

You can also find me on: How to use Photoshop in Ubuntu


23 January 2013 For quite some time Photoshop used to be the one app that kept me from completely switching away from Windows. For everything else, Ubuntu is the OS of my choice. But dual boot sucks, and I don't want to switch OSes every time I need to use Photoshop. I want to use Photoshop in Ubuntu. It is certainly possible to do so, but i have a few requirements: I need Photoshop to be 100% stable - it shall never crash. Even 99% stable is not tolerable have acceptable performance - occasional freezes or (extremely) long rendering times are not acceptable fully integrate into Ubuntu - should behave like a native Ubuntu app: e.g. shows the appropriate icon on [alt]+[tab] command. should be searchable and launchable from Ubuntu dash. So to summarize what i want in one sentence: Photoshop should behave and feel (almost) the same way as it does for Windows users.

High Level summary of what we need to do:


We are going to use VirtualBox, and install Windows and Photoshop on it. We are then going to configure it in a way that Photoshop fully integrates into the OS, behaves and feels like a native Ubuntu app. When we are done with it we won't even notice that it runs in a VirtualBox.

Foreword:
Peeking ahead at the long list of steps you have to do to set up Photoshop, you probably ask yourself two questions: "Why not just use wine instead?" or even "Why not just use gimp instead?" Regarding Gimp: Let's not go there. This post shall not be about gimp vs. Photoshop. Gimp is a fine piece of software, but growing up with Photoshop and knowing it inside out, I am just too lazy to spend the amount of time necessary to adjust to the a new interface, and (re)learn how to use the tools. If you are a happy Gimp user you can stop reading here, but to go on with this post lets just assume we want to use Photoshop in Ubuntu. Regarding Wine: With Wine it requires fewer steps to set up Photoshop, and it (apparently) works with every version, including CS6. But the thing is, at least for me, it is not 100% stable. It might be 99%, but

1 of 10

18/02/2013 12:47

prtfl.io

http://www.prtfl.io/muellerwolfram/blog/2013/1/23/how-to-use-photo...

that last 1% could potentially mean that you lose unsaved work. Which is one of the most frustrating things ever, and not tolerable.

Agenda
Installing VirtualBox Installing Windows Installing Photoshop Configuring VirtualBox to better integrate into Ubuntu

Installing VirtualBox
Note: Im going to keep the first couple of steps of the how-to relatively compact. There are plenty of guides on how to install VirtualBox, set up a new VM and install Windows on it, on the internet, and if you get stuck at one point, google is your friend. Instead of rewriting stuff that has been said before, I'm going to point you to great tutorials published elsewhere. There are two versions of VirtualBox available for Ubuntu. One packaged by Ubuntu themselves, one by VirtualBox. Due to licensing (i guess), the Ubuntu Package doesnt include all features (e.g USB support), so I recommend that you just go ahead to VirtualBoxs download page and download the right package for your system from there.

Install Windows
There is a very good article on how to install Windows XP on linuxjournal.com so Im just going to refer you to that. Its relatively straight forward, and you shouldnt run into any problems. Just two notes: First, give the VM as much RAM as you can spare, preferably 4GB (if you have 8 in total). Second, remember to install the Guest Additions as described at the end of the article. Installing Windows 7 requires basically the same steps. Here is a guide on how to do that. Performance wise, at least on my machine, Windows XP does actually perform better. Startup time for my XP VM is about 14 seconds until Photoshop is ready to use. With my Windows 7 VM it takes about 18 seconds. Not a huge difference, so just use whatever Windows version you have at hand.

Install Photoshop
Now boot up your new Windows VM, grab yourself the latest demo of Photoshop from adobe (or use the full version if you own one) and install it. If you dont need the latest and greatest, you can download a full version of Photoshop CS2 for free here.

Configuring VirtualBox to better integrate into Ubuntu


2 of 10 18/02/2013 12:47

prtfl.io

http://www.prtfl.io/muellerwolfram/blog/2013/1/23/how-to-use-photo...

Ok, now its getting interesting. But first lets recap what weve done so far: We installed VirtualBox on Ubuntu, we set up a new virtual machine, we installed first Windows on that virtual machine, and then Photoshop. If you stop here, you will be able to manually start the VM, open Photoshop, and enjoy using it on Ubuntu. But we can do better. There are a couple of neat tricks to make applications running inside a VM more integrated into Ubuntu:

Shared folders
In order to be able to open files from your Ubuntu (or other Linux host system) you have to add a folder (probably your /home dir) as a shared folder to VirtualBox. This answer on askubuntu.com describes pretty clear how to accomplish that. Its pretty straight forward: Open VirtualBox, select your VM, click Settings -> shared Folders, and add your desired folder.

Make sure you check auto-mount, so you dont have to set it up everytime you restart your VM. In your VM, if your folders dont automatically show up in your explorer, you need to manually create a new network place. Here is a guide on how to do that in Windows 7. When your are at step 7 of that guide, if you click browse, your shared folders, that you set up in the VirtualBox settings, should show up.

Seamless Mode
Seamless Mode disables the desktop of your VM. It doesnt run the application within a windows desktop, instead it shows the running (windows) applications right next to running applications in Ubuntu. Switching between native apps and vm apps with [alt]+[tab] should be way smoother now. If you cant

3 of 10

18/02/2013 12:47

prtfl.io

http://www.prtfl.io/muellerwolfram/blog/2013/1/23/how-to-use-photo...

image what this looks like, check out this screenshot from techrepublic.com To get this working yourself, start the VM and open up Photoshop. In the Ubuntu menubar of your VM window select View -> Switch to seamless mode. I recommend auto-hiding the windows taskbar, and showing VirtualBoxs Mini Toolbar. Go to Machine -> Settings -> General -> Advanced and check Show Mini Toolbar in Seamless Mode.

Saving the State of a VM


If you close the VM, by clicking the X in the mini toolbar (see picture) or hitting [hostkey]+[q], you will be asked if you want to shutdown, power off or save the machines state.

Saving the machines state is what we want. It is like going in suspend mode in Ubuntu. If you have Photoshop running in Seamless Mode and you save the state of the machine, the next time you open up the VM it will open up Photoshop in Seamless Mode right where you left it. Thats handy for two reasons: First, you dont need to manually open Photoshop and switch to Seamless Mode every single time. You just open the VM, one click, and you are good to go. Second, when you wake up the VM you dont need to wait until Photoshop launches, since it is already running.

Utilising VirtualBoxs command-line tools


So now we have a Virtual Machine set up with Photoshop, and every time we launch it Photoshop is already running, every time we close it, we save the state of the machine. Thats already a pretty decent setup, but in order to launch Photoshop you still need to open up VirtualBox GUI first, select your VM and start it. Fortunately, VirtualBox can be completely controlled by command line commands. To try it out, run the command
VBoxManage startvm name-of-your-vm

or
VBoxManage startvm /home/user/path/to/your/vm.vbox

4 of 10

18/02/2013 12:47

prtfl.io

http://www.prtfl.io/muellerwolfram/blog/2013/1/23/how-to-use-photo...

You can find the location of your VM Image in Settings -> Storage (see picture)

Bash alias
To make our lives easier, we can set up a bash alias for that command, like so: Open up your bashrc file (or whatever config file for the shell you are using)
vim /home/$USER/.bashrc

and add the line


alias photoshop="VBoxManage startvm name-of-your-vm"

close and reopen your terminal. Now you can just type
photoshop

Setting up an Ubuntu Desktop Entry


Opening Photoshop is a now a simple cli command away. But we can do even better. We can set up an Ubuntu desktop entry which will make Photoshop accessible from Unity Launcher and Unity Dash. It will also let us choose an icon that it will show when we switch apps with [alt]+[tab]. Let's go ahead an create a desktop with your favorite text editor:
vim /home/$USER/.local/share/applications/photoshop.desktop

5 of 10

18/02/2013 12:47

prtfl.io

http://www.prtfl.io/muellerwolfram/blog/2013/1/23/how-to-use-photo...

Copy this code into it:


#!/usr/bin/env xdg-open # Change your username in line 7 + 8 [Desktop Entry] Version=1.0 Name=Photoshop Exec=/home/username/bin/photoshop.sh Icon=/home/username/.local/share/icons/hicolor/128x128/apps/photoshop.png Type=Application StartupWMClass=VirtualBox Categories=Development;Office;

We need to create two missing files though. See line 7 in your desktop entry file: the exec command runs a simple bash script that we will create in a short moment. Line 8 points to an icon that we will download and save in that location.

The bash script


open vim or any other text editor
vim /home/$USER/bin/photoshop.sh

copy this code:


#!/bin/bash VBoxManage startvm /home/username/path/to/your/vm.vbox

paste it, save it and make the file executable:


chmod +x /home/$USER/bin/photoshop.sh

The bin folder in my home directory is where I place my custom bash scripts. You can change that location if you want, just remember to point to the right place in your desktop entry.

The icon
I got mine from here. There are other create icons on that site, just pick one and save it in /home/username/.local/share/icons/hicolor/128x128/apps/photoshop.png

Conclusion
That's it. We are done. What we have now is a stable version of Photoshop fully integrated into Ubuntu. I've been using this set up for a couple of days now, and I'm pretty happy with it. The performance of Photoshop is good, not noticebaly worse than on windows. Starting and closing Photoshop happens in a decent amount of time; 14 seconds and 7 seconds respectively. I love how it integrates with my other apps. When I switch between native apps and Photoshop, I don't even notice that it runs in a VM. Because I'm opening everything through the Dash, making it possible to launch Photoshop that way was quite important to me. Lauching Photoshop through Dash looks like this:

6 of 10

18/02/2013 12:47

prtfl.io

http://www.prtfl.io/muellerwolfram/blog/2013/1/23/how-to-use-photo...

Switching with [alt]+[tab] shows the right icon:

The only thing that's annyoing though: In order to show you the right icon when you [alt]+[tab] through applications, Ubuntu is matching the WM_CLASS of the current window with the StartupWMClass that we declared in our desktop entry. Unfortunately VirtualBox gives every VM the same WM_CLASS. What that means is, every instance of VirtualBox shows the Photoshop icon. If you only use VirtualBox for Photoshop, than that's fine. But if you, like me, use it to run MacOS (for xcode), be aware that your

7 of 10

18/02/2013 12:47

prtfl.io

http://www.prtfl.io/muellerwolfram/blog/2013/1/23/how-to-use-photo...

MacOS VM is showing the Photoshop icon now as well. I haven't found a work around for that, comments are welcomed. Hi there, if you are a developer and you would like to have an portfolio site like the one you are on right now, you are in luck: I'm building a free webapp for developers to create professional portfolio sites. Sign up for the beta list, and I tell you when it's ready. Email Address Leave a comment

8 of 10

18/02/2013 12:47

prtfl.io

http://www.prtfl.io/muellerwolfram/blog/2013/1/23/how-to-use-photo...

ALSO ON PRTFL.IO

RECOMMENDED CONTENT

What's this?

prtfl.io 4 comments prtfl.io 4 comments

Oil Industry or Government - Who is Subsidizing Whom? Exxon If You're Planning to Add a New Pet, Consider Starting With a Shelter Citi Women & Co.

21 comments

Discussion

Community

Share

Richard Bensley

a month ago

That version of CS2 you linked is not free. Adobe had to make a statement it's for existing CS2 license holders only, as the activation servers are now offline. For CS3 and above, Virtualbox only partially supports Direct3D 8/9 and OpenGL 2.1 for acceleration. And the GPU driver it installs is not CUDA/OPENCL compatible so the canvas, spatial filters, and anything else that can use GPU acceleration will be gimped and not function as well. People seriously wanting an advanced suite of 2D tools for Linux should look at Krita, Cinepaint, Darktable, Blender or a Nuke license.
1

Reply

Share

prtflio

>

Richard Bensley 25 days ago

by free i meant you can download them, from their site, use an activation key from their site, and have a fully functional version of CS 2 without being charged. you might argue that it wasn't adobe's intent to give away CS 2 for free, or even say that it is illegal. but given that the download site is still publicly available, I think they will have a hard time arguing that, and frankly I think they couldn't care less. as for hardware acceleration: I have the guest additions and direct3 installed on the guest (win xp), and i have hardware virtualization turned on in my settings. i also read that its supposed to be "experimental" but so far it works just fine. given that hardware is getting stronger, and virtualbox software is getting better, I still think this is a solid setup. but thanks for pointing me to darktable. looks awesome. i will definitely check it out for photo editing. for web stuff i will stick to PS for now.
0

Reply

Share

Marin Petrov

a month ago

Hi, what would you say about the performance hit on virtual machines ? I am used with working on huge files which needs a lot of memory and when I did this I had problems with opening them and working with them. Thanks.
1

Reply

Share

prtflio Mod

>

Marin Petrov a month ago

depends on your hardware probably.


9 of 10 18/02/2013 12:47

prtfl.io

http://www.prtfl.io/muellerwolfram/blog/2013/1/23/how-to-use-photo...

10 of 10

18/02/2013 12:47

Você também pode gostar