Archive for February, 2010

SLF4J and making JUL shut up

Monday, February 15th, 2010

I’ve decided to switch to the Simple Logging Facade for Java (SLF4J) plus Logback to bridge java.util.logging (JUL), Log4J, and Apache Commons Logging all into one log output.

Problem is, JUL won’t shut up. Frameworks that log to JUL output the log to the console, and then SLF4J repeats it right after. However, putting this code in before running SLF4BridgeHandler.install() seems to fix it:

java.util.logging.Logger root_logger = java.util.logging.LogManager.getLogManager().getLogger("");

java.util.logging.Handler[] root_handlers = root_logger.getHandlers();

rootLogger.removeHandler(root_handlers[0]);

Now I get one single log output alone.

Trying to get OSX to work well in VirtualBox

Friday, February 12th, 2010

Update: This article is out of date. Virtualbox officially supports OSX nearly flawlessly under 3.2: native EFI booting, USB keyboard/mouse, networking, and sound (using a third party driver). The only thing missing is 3D acceleration support.

Now that VirtualBox 3.1.4 is out, I decided to try OSX. I would like to thank this thread on the VBox forums for a few hints on how to do this.

I am doing this on a Core 2 Duo. This should work on any processor that has at least SSE3.

These instructions are for people who are used to using VirtualBox.

You need:

  1. At least VirtualBox 3.1.4
  2. A Hackintosh ISO. I used iDeneb 1.6 Lite, which is based on OSX Leopard 10.5.8. Others may or may not work depending if they include the appropriate hacks.

Make a new virtual machine, set:

  1. Set it for FreeBSD
  2. With at least 1GB of memory
  3. And at least 10GB of HD space

Set the additional settings of:

  1. System->Motherboard->Enable IO APIC to on
  2. Do NOT enable EFI, it is not complete enough for OSX yet
  3. System->Processor->Processor(s) matching what you actually have
  4. System->Processor->Enable PAE/NX to on
  5. Display->Video->128MB of video memory, with 3D Acceleration enabled
  6. Storage->IDE Controller->Type set to ICH6
  7. Network->Adapter 1->Attached to Bridged Adapter, advanced->Intel PRO/1000 MT Desktop (NOT MT Server or T Server)

Exit VirtualBox, edit the XML definition for the machine. For me, and I named my machine OSX, this was under ~/.VirtualBox/Machines/OSX/OSX.xml. Add the line…

<ExtraDataItem name="VBoxInternal2/SupportExtHwProfile" value="on"/>

… inside the <ExtraData> block, and save it and restart VirtualBox.

Mount the iDeneb ISO inside your virtual machine, and start it up. Remember to press enter to start the CD on boot.

Use the disk utility to format your drive to HSF journaled. Select that drive in the installer and hit the customize button before installing.

Select the following options in the iDeneb OSx86 Components menu:

  1. Kernel->Qoopz
  2. Essential Patches->ACPI Fix
  3. Essential Patches->PS/2 Drivers->ApplePS2 Old
  4. Drivers->Chipset->ICHx Fixed

Now, just install. This takes about 20 minutes.

To get network working after boot, go into the client’s menu while running and do Devices->Network Adapters, uncheck Cable connected, hit okay, go back in, and check Cable connected. After that OSX will connect to the network, and you have to do this every time you boot.

Sound cannot be fixed at the current time: VirtualBox’s AC97 emulation supports a version of ICH AC97 too old for the popular third party AppleAC97Audio.kext to support. Hopefully VirtualBox will get a HDA emulation, which will improve chances of being emulated correctly.

2D speed seems to be pretty fast without specific drivers, although some operations will be noticeably slow. I wish there was a specific video driver for this.