2010-03-21

Installing Mythbuntu backend on Virtualbox virtual machine running on Mac OS X

This is just a rough outline of steps, not a how to!

Install Sun Virtualbox on Mac.

Download ISO of Mythbuntu

Create new Linux virtual machine in Virtualbox. I used 8 GB as the disk size (figuring I would store recordings on an external drive) and 500 MB RAM (no particular reason.

Change settings on the virtual machine's Details list:

  • Click on Storage then under the CD-ROM entry browse to and select the Mythbuntu ISO.
  • Click on Network and then select bridged as the network type instead of NAT (I actually did this after the Mythbuntu install was finished so I am not sure if there would be problems selecting it intitally).
Boot up the virtual machine and go through the Mythbuntu basic install process. I chose to install both a frontend and a backend even though I am not planning to watch recordings on the virtual machine; I did this because I believe some settings are only accessible through the frontend. Other than that I think I just accepted all the defaults.

When it got to the part of the process when the Mythbuntu backend setup program ran I escaped out of it to get to the desktop because I wanted to make some changes to the system before I set up the backend.

Set the virtual machine to use a static IP address:
  • Right click on the network manager icon on the right side of the virtual machine menu bar and selecting edit connections.
  • Select Auto eth0 under Wired
  • Click Edit
  • Select IPv4 Settings
  • Enter values in all fields; Apply button will grey out unless all required fields are completed.
  • Click Apply
Set up the virtual machine to use an external hard drive (for storing recordings).
  • Shut down virtual machine.
  • Go to Details list for VM and click on Shared Folders
  • Browse to external drive and designate it as a shared folder.
  • Install VirtualBox Guest additions on the VM by:
  • Restart VM
  • Click on the Window for the VM to make it active, and then on the Mac menubar click on Devices and then select Install Guest Additions (if the VirtualBox program window is the active window you can't see the Devices menu). This causes a virtual CD to be mounted to the VM.
  • Follow the instructions How to install VirtualBox Guest Additions in Ubuntu with the following changes: run the installer by using "sudo ./VBoxLinuxAdditions-x86.run" otherwise you will get command not found.
  • Reboot VM.
  • Test mounting external hard drive by making mount point and then running this:
  • sudo mount -t vboxsf SharedFolderName \MountPointPath where SharedFolderName is the name you gave to the shared folder in VirtualBox and \MountPointPath is the path to the mount point you created.
  • However, if you mount the shared folder this way it will be mounted as owner root, group root and read only.
  • Dismounting the shared folder and setting the ownership and permissions on the mount point doesn't work to change this because the next time you mount the shared folder the ownership, group, and permissions will revert.
  • This is the mount command that finally made it possible to write to the shared folder: sudo mount -t vboxsf -o uid=andy,gid=users SharedFolderName /MountPointPath/
  • Once I got that working I added it to the /etc/fstab file so that the shared folder would mount on boot by using sudo nano /etc/fstab to open the fstab file in a text editor and then adding this to the bottom of the file SharedFolderName /MountPointPath vboxsf gid=105,uid=103
  • The uid and gid are for the user mythtv and the group mythtv. I tried mounting it with uid=1000 and gid=1000 but mythbackend was not able to write recording files to it, so I just made mythtv the owner of the mount.
Once I got the shared folder working properly I finally ran Myth Backend Setup (Applications -> System -> Myth Backend Setup). Here are the fields that I set differently than the default:
  • General-Host Address Backup Setup-Local Backend-IP Address = static IP address of VM
  • General-Host Address Backup Setup-Local Backend-Security Pin = 0000
  • General-Host Address Backend Setup-Master Backend-IP Address = same
  • General-Locale Settings-Channel frequency table = us-cable (selected)
  • Capture Card Setup-Card type = HDHomeRun DTV tuner box (selected)
  • Capture Card Setup-Available Devices = 1019A9DB-0 (selected)
  • On Input Connections I scanned channels using Cable High.
  • After the channel scan was done and I added all the ATSC channels I used the Channel Editor to manually fill in the XMLTV ID field for each high def channel. For some reason SchedulesDirect.org doesn't link up to the high def channels correctly, so I just fill in the XMLid values for the broadcast versions of the channels, which I looked up on SchedulesDirect.org
  • Then I went to the Storage Groups section, clicked on default, and then filled in the mount point of my shared folder as the default storage location.
Unfortunately, the shared folder approach was too slow, and when I tried to play back recordings stored on the shared folder the video keep halting and stuttering. So it was on to plan b.

I shut down the VM and then in VirtualBox I disconnected the shared folder from the VM by clicking on Details - Shared Folders and then removing the shared folder.

Next in VirtualBox I created a new virtual disk on my external hard drive and made it as big as I could. I picked expandable, instead of fixed, because when I tried fixed it said it would take 20 hours to format the virtual disk!

Then in VirtualBox I attached the new virtual disk to my VM and then started the VM up. From there I used regular linux commands to partition and format the new virtual disk, and then I added it to the /etc/fstab file so it would mount on boot to the same mount point as I had previously used for the shared folder (and obviously I removed the old /etc/fstab entry for the shared folder while I was in there.

Then I did a sudo mount -a to mount the new virtual drive and tested it by recording a show in MythTV, and everything worked great.


    1 comment:

    ksanger said...

    Andy; Thank you for this. I'm trying to setup MythBuntu under Ubuntu to hdhomerun tuner. Your note on VirtualBox network settings enabled hdhomerun_config to see the tuner. I'm certain this is going to save me a lot of work. Note I couldn't get MythTV to install under Ubuntu 12.04 so I thought this might do the trick. And I've had an interest in VirtualBox and thought installing Mythbuntu might be a good introduction.

    Thanks again.