As the doctor gone rogue

February 6, 2014

Converting virtual machine raw image .img to vmdk

Filed under: bash, Virtual Machine — Tags: , — hypotheses @ 11:26 am

OK, you got “.img” virtual machine image. Now what?
Diving in VMWare, Oracle Virutal Machine, etc, etc, there is not a shadow of the option to choose “new virutal machine” from .img image.

What should I do?

1. Download Qemu (ported version for OSX) http://www.kju-app.org/

2. After installing it on Mac (works fine for me on Maverick),

cd /Application/Q.app/Contents/MacOS/qemu-img
./qemu-img convert -f raw -O vmdk /Volumes/xxx/rawdisk200gb.img /Volumes/xxx/vdisk200gb.vmdk

3. Next, open up vmware to create a new virtual machine.
4. Choose continue without disk > choose an existing virtual disk
5. Follow the instruction to start up your new machine 🙂

Thanks to http://www.igorkromin.net/?x=entry:entry130909-170324 for written up the solution for mac.

Advertisements

April 30, 2010

Image processing in R — Convert EPS to PDF and others

Filed under: bash, genetics, R — Tags: , , , — hypotheses @ 1:53 am

I do a lot of plots and graphs in R, and I found that most fonts will look disproportionate if I originally save the graphic output from R using a function such as png(). So the solution I have till now is to save all of my plots using


postscript("file",paper="letter")
#as I normally want the plot to be in the size of most paper used to print here in the US
#by default the paper size is "A4" though.

Then, the next problem seems to be how do I convert these EPS files into PDF or other format.On Linux, so far my solution seems to be using ImageMagick,

convert

. However, on OsX, if you don’t want to install ImageMagick, they already have a command built-in.

Through a series of these command, you will convert your file into a subfolder with the appropriate extension.


#echo *.eps | xargs -n1 pstopdf && mkdir png; sips -s format png *.pdf --out png/
<pre>echo *.eps | xargs -n1 pstopdf && mkdir png; sips -s format png *.pdf --out png</pre>
# "YOU NEED TO GET RID OF THE / AT THE END TO AVOID ERROR ABOUT DIRECTORY NOT FOUND"

Although you will get a warning that the extension has been change to png, look inside “png” directory, and you will find all your files inside neatly converted to the format you want. You can use

sips

to convert to jpeg or other format as well.

Create a free website or blog at WordPress.com.