Thursday, December 18, 2014

ESX & OS X Yosemite 10.10.1

Last week I upgraded my Caching Server from OS X 10.9 Mavericks to 10.10.1 Yosemite.
It runs on my ESX.

I installed the latest vmware tools. Version 9354.

The problem was, that now I could no longer log in to my server.
It was hanging after I entered the password.
Loginwindow got stuck.

I could log into the server per SSH, so that was not a problem.
When I killed the loginwindow process using

killall loginwindow

I could login again. Most of the times.

Finally I got to the point at which I made the vmware tools responsible for this behavior.
As soon as I had uninstalled them, the situation got better.

So. What now.

I finally had an idea. Sure I did - otherwise I wouldn't be writing this, would I.

I knew that VMware Fusion supported Mavericks and had recently been updated.
So my guess was, that Fusion may contain a newer version of the vmware tools.

So I opened this image:

/Applications/VMware Fusion.app/Contents/Library/isoimages/darwin.iso

And installed the package that I found there.

Now I am running vmware tools version 9504 and the problems are gone.

BTW:
The same thing applies to Windows 10.
Just mount this image:


/Applications/VMware Fusion.app/Contents/Library/isoimages/windows.iso

Inside the Windows 10 VM and install the VMware Tools from there.



Wednesday, March 26, 2014

Expand OS X virtual disk in esxi

As you all know, it is currently not possible to expand a disk (vmdk) with 'OS X' on it in esx so that you get more space.

Well, that's not quite true. You can expand the disk. That's not the problem. You can do that using the command 'vmkfstools -x' as described here:

VMware KB: Adding space to an ESXi/ESX host virtual disk

The problem is that by using disk utility it is currently not possible to expand the size of the partition:

VMware KB: Unable to extend a partition using the guest Disk Utility after extending disk of a virtual machine running Mac OS X

So, what's the solution?

Well, it's actually quite simple:


  1. Create a new Hard disk of the size you need.
  2. Restore the contents of the too small disk to the new disk using disk utility.
  3. Detach both disks from the virtual machine
  4. Rename the old disk by issuing the command 'vmkfstools -E OldName.vmdk OldName.off.vmdk' as shown here VMware KB: Renaming a virtual machine disk (VMDK) via the vSphere Management Assistant (vMA) or vSphere CLI (vCLI)
  5. Rename the new disk by issuing the command 'vmkfstools -E NewName.vmdk OldName.vmdk'
  6. Attach the new disk to the VM
  7. If everything is working, delete the old disk

Tuesday, March 25, 2014

Virtualize physical OS X Server: Best practice

So you plan to virtualize a physical server running OS X?

Too bad all the tool for converting a physical server into a virtual server run on Windows or Unix.

Wenn, actually there is (quite) a simple way to do this. This method is independent of any product and can be used with any virtualization such as Parallels, VMware.

Just follow these steps:

On you physical server:

  1. Boot from an external volume and create a disk image of your server using 'Disk Utility'.
  2. After the disk image has been written, mount it and verify that it can be read and has all the data required on it.
  3. Select the image in the sidebar and run the menu 'Images > Scan Image for Restore'
  4. Turn off your physical server
Intermediate steps:
  1. Copy your disk image to a server that is accessible via AFP
  2. Note down the address, path and the credentials needed to access this image via AFP.
Inside virtualization:
  1. Create a new virtual machine for OS X.
  2. Make sure you have access to a bootable OS X media inside the virtualization. Normally this is done by using a disk image that is assigned to the virtual machine as a  CD ROM drive. If you are unsure how to create such a medium, you can use an app like DiskMaker X to create a bootable USB stick from which you can create a bootable disk image.
  3. Create a HDD in the virtual machine that is large enough.
  4. Create a network interface that has access to a network, preferably one that assigns addresses via DHCP.
  5. Start the virtual machine
Inside the virtual machine:
  1. The VM will now boot using the disk image supplied. In this example I am using a bootable "OS X 10.9 Mavericks" but the same method works with other versions.
  2. Don't start the installation process!!! Remember: we want a virtualized copy of our physical server, not a new server
  3. From the 'Utilities' menu select 'Terminal'.
  4. Once the terminal is running make sure we have an IP address by typing 'ifconfig'. The line starting with 'inet' should now show a valid IP address.
  5. Now we need to mount our disk image. There is a little trick involved here. As we have to mount our server via command line, we need a folder to attach our mount to it. In order to do so, we need a writable directory.
  6. One directory that is writeable is the Trash. So we cd into that directory by typing the command 'cd Library/.Trashes'.
  7. We are now in the directory '/var/root/Library/.Trashes'. Check that it is writeable by creating a folder using the command 'mkdir mnt'. If you see this 'mkdir: mnt: Read-only file system' you have to find another folder that is writable. There is always one as the system itself need to write certain files.
  8. So once we have created our directory, we can mount the AFP share that host our disk image. This is done by issuing the command (by replacing 'myusername', 'myserver' and 'mysharedvolume' with you own data as noted above)  'mount_afp -i afp://myusername@myserver/mysharedvolume mnt'   
  9. You are now requested for the password of the AFP user you use to mount the volume
  10. Once the volume has been mounted, you can verify everything is working by showing the contents of the mount volume by issuing the command 'ls -l mnt'.
  11. If your disk image is visible in here, we're almost done.
  12. Quit the Terminal
  13. Open 'Utilities > Disk Utility'
  14. Select the disk image of your virtual machine and go to the 'Restore' tab.
  15. In here, drag the disk you selected on the left that is now listed as 'Source' to the 'Destination field.
  16. Now we click on the button 'Image…' next to the 'Source' field. Here we select the image we created from our physical server that is now located on our AFP share we mounted in the steps above.
  17. Once this has been done, we can click on 'Restore'.
  18. The disk image of our physical server is now being restore to our virtual server.
  19. Once this has completed, we can quit 'Disk Utility' and go to 'Startup Disk…' that can be found in the menu under the Apple logo.
  20. Here we select our newly restored disk.
  21. Select 'Shut down' from the Apple menu
  22. Go to the settings of your VM and adjust network and RAM configurations as required. Detach the image file attached to the CD ROM drive.
  23. Start the VM.
  24. Et voilĂ  ! An exact copy of your physical server is now virtualized.

Tuesday, March 18, 2014

Apple Remote Desktop or another administration application is currently running.

Have you ever encountered this message:

«Apple Remote Desktop or another administration application is currently running.»
This message shows up when you try to observe or control a Mac that is itself running 'Remote Desktop Admin'.

If you have access via ssh, you can try this:


connect to the client via ssh
enter these commands:

defaults write /Library/Preferences/com.apple.RemoteManagement AdminConsoleAllowsRemoteControl -bool true
sudo killall 'Remote Desktop'

From now on, you are able to access this client even though Remote Desktop Admin is running. 

I know you can adjust this setting in the preferences.
But, if you are not able to adjust them, do it via ssh.


Tuesday, January 28, 2014

Deploy Audio Content fo Garageband in Mavericks

Well, the basic deployment is easy.

Download the app from the app store and deploy it using images, software distribution, whatever you like. Just make sure you have enough licenses.
Which ist no longer that big of a problem since GarageBand comes free with new Macs….

The problem however is, that Garageband 10.x wants to download additional stuff when GarageBand ist started the first time.

This is an issue and annoying because
a) it is 1.4 GB and is not using the local software update or caching server
b) non-administrators are not able to install this package.

When started GarageBand begins to downloads this:

http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_GarageBandCoreContent.pkg

That means, if you download this package, you can deploy it right along with GarageBand.

Enjoy.

Update:

With Garageband 10.0.2 there seems to be some additional content available.

It downloads this plist: http://audiocontentdownload.apple.com/lp10_ms3_content_2013/garageband1002_en.plist?app=GarageBand&ver=10.0.2&country=CH&language=de&o If you examine this plist, you can find out, which packages are installed. Garageband downloads and installs these packages:

MAContent10_GarageBandCoreContent.pkg
MAContent10_GarageBandPremiumContent.pkg
MAContent10_GB_StereoDrumKitsSongWriter.pkg
MAContent10_GB_StereoDrumKitsAlternative.pkg
MAContent10_GB_StereoDrumKitsRock.pkg
MAContent10_GB_StereoDrumKitsRnB.pkg
MGBContentCompatibility.pkg


To get them, download these packages:

http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_GarageBandCoreContent.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_GarageBandPremiumContent.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_GB_StereoDrumKitsSongWriter.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_GB_StereoDrumKitsAlternative.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_GB_StereoDrumKitsRock.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MAContent10_GB_StereoDrumKitsRnB.pkg
http://audiocontentdownload.apple.com/lp10_ms3_content_2013/MGBContentCompatibility.pkg

Tuesday, January 21, 2014

How to split a PDF with spread pages to single pages

I recently bought a book that is not available as eBook.

As I wanted to take the book with me on my iPad I thought that I would digitize it and convert it to an eBook.

Ok. Sounds easy.
It is not.

First it it is not that easy to scan a complete book with around 330 pages.
But ok. That was doable. I used a Canon Multifunction Copier 'iR-ADV C5030'.

I scanned around 100 pages and sent the PDF as Email.

Now comes the interesting part.

I used Adobe Acrobat Pro version 10.1.9 do join the PDF.
No now I had a complete document of the book.

But wat, there's more.
The thing is that when scanning this way, I get a PDF that contains both the even and the odd page of a book on a singe page within the PDF.
This is not what I want.

So here's the trick:

The scan was quite precise. So I used the function 'Recognize Text > In this File'.
This not in order to get the text. What this function also does is rotate the scans so that the text is horizontal.
The next step was this: Save the PDF and make a copy of it. Open the copy and crop the pages so that only the even pages are left. Make another copy and crop it so that only the odd page numbers are left.
So OK. Now we have tow PDF files. One contains all pages with even page numbers, the other one contains all the pages with odd page numbers.
Fine. But now I need to merge these two files. Having used AppleScript a lot, I quickly came up with a script that does just that:


property pages_even : "scans_even.pdf"
property pages_odd : "scans_odd.pdf"

tell application "Adobe Acrobat Pro"
activate

set c to number of pages in document pages_odd
repeat with i from 1 to c
set b to (i * 2 - 1) as integer
-- display dialog "inserting page " & i & " after " & b
insert pages document pages_even after b from document pages_odd starting with i number of pages 1
end repeat
end tell


This takes every page of the odd pages and inserts it in the right place in the even document.
This way I end up having a PDF that contains single pages instead of spread pages.