Blog

Ponderings of a kind

This is my own personal blog, each article is an XML document and the code powering it is hand cranked in XQuery and XSLT. It is fairly simple and has evolved only as I have needed additional functionality. I plan to Open Source the code once it is a bit more mature, however if you would like a copy in the meantime drop me a line.

Atom Feed

Connecting to OpenIndiana by XDMCP

Enabling XDMCP in OpenIndiana

I have a small NAS which I have built which run's OpenIndiana oi_151 and I wanted to be able to headlessly administer it, whilst I have SSH and thats all I really need, sometimes its nice to use a remote desktop environment.

XDMCP is a fundamental part of the X Window System, and one feature it offers is the ability to export your display across a network.

To enable XDMCP on OpenIndiana simply modify the XDMCP section in the file /etc/gdm/custom.conf so that it looks something like this -

# GDM configuration storage

[daemon]

[security]

[xdmcp]
Enable=true

[greeter]

[chooser]

[debug]
                
            

Now you just need to restart the GDM service -

$ sudo svcadm restart gdm                
            

Thats all there is to it!

Testing the XDMCP Connection

To connect to the XDMCP server, you need an X Server for your client machine, for Windows you can use Xming, or if you are on a Linux/Unix like platform you could use Xephyr, Xvfb, Xnest or similar. Personally im on MacOSX and Xephyr works very well for me -

$ Xephyr -query mnemosyne                
            

Screenshot of MacOSX Xephyr connected to OpenIndiana

Adam Retter posted on Saturday, 23rd July 2011 at 17.02 (GMT+02:00)
Updated: Saturday, 23rd 2011 at July 17.02 (GMT+02:00)

tags: OpenIndianaXDMCPMacOSXXephyrSolaris

0 comments | add comment

Installing Netatalk on OpenIndiana

ZFS for Mac Storage and Time Machine

It is possible to configure your OpenIndiana system to operate as a file server for your Mac using the AFP protocol, and if you have lots of lovely ZFS storage attached then it makes lots of sense. You can also configure OpenIndiana to act as as Time Capsule for your Mac's Time Machine!

The instructions below relate to OpenIndiana oi_151, and Apple Mac OSX Snow Leopard, however the procedure is probably much the same for all OpenIndiana versions. The Time Machine configuration does not work yet for Apple Mac OSX Lion, when I figure this out I will post the details.

Configuring OpenIndiana as an AFP File Server

First you need to install the pre-requisites for building Netatalk on OpenIndiana. You need gcc and BerkelyDB -

$ sudo pkg install gcc-dev 
            

You can download Berkeley DB from here. There are reported issues with version 5 and Netatalk, and so I used the latest 4.8 release. You then need to build and install Berkeley DB -

$ tar zxvf db-4.8.30.tar.gz
$ cd db-4.8.30/build_unix
$ ../dist/configure --prefix=/usr/local
$ make
$ sudo make install
            

Netatalk is a software package that acts as an AFP server. You can download Netatalk from here. You then need to build and install Netatalk -

$ tar xvjf netatalk-2.1.5.tar.bz2
$ cd netatalk-2.1.5
$ ./configure
$ make
$ sudo make install
            

After the install, Netatalk will be configured to share each users home folder. If you have additional folders that you wish to share with all users via. AFP you need to add them to /usr/local/etc/netatalk/AppleVolumes.default. I added these entries for my system -

/thevault/private/%u Private allow:@vusers
/thevault/public Public allow:@vusers
/thevault/timemachine TimeMachine allow:aretter
            

If you have different requirements for different Users then you can copy /usr/local/etc/netatalk/AppleVolumes.default to a Users home folder as AppleVolumes or .AppleVolumes and override the share settings for the user there.

If you want your AFP File Server to be auto-magically found via Apple's Bonjour service, you need to configure an Avahi service, this is done by creating the file /etc/avahi/services/afpd.service -

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
    <name replace-wildcards="yes">%h</name>
    <service>
        <type>_afpovertcp._tcp</type>
        <port>548</port>
    </service>
    <service>
        <type>_device-info._tcp</type>
        <port>0</port>
        <txt-record>model=Xserve</txt-record>
    </service>
</service-group>

You now need to enable the Netatalk service and also the Avahi service, if you configured it above. Avahi also requires the Multicast DNS service -

$ sudo svcadm enable dns/multicast:default
$ sudo svcadm enable system/avahi-bridge-dsd:default

$ sudo /etc/rc2.d/S90netatalk start
            
Configuring TimeMachine on the Mac

If you created a TimeMachine AFP share above and wish to use your OpenIndiana server as a TimeCapsule also, then firstly you have to tell the Mac to allow unsupported network volumes for Time Machine. This can be done from the Terminal.app thusly -

$ defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
            

You need to create a sparse disk image file, which will be used for the content of the TimeMachine backups. This can be done with the Terminal.app. The naming of the disk image is quite specific and should be of the form hostname_MACaddress.sparsebundle. e.g. -

Find your hostname -

$ hostname
hollowcore
            

Find your MAC Address -

$ ifconfig
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 90:27:e4:ea:7b:d4 
    inet6 fe80::9227:e4ff:feea:7bd4%en1 prefixlen 64 scopeid 0x4 
    inet 172.16.16.2 netmask 0xffffff00 broadcast 172.16.16.255
    media: autoselect
    status: active
</xh:pre>

Now substituting your own Hostname in place of 'hollowcore' and your own MAC Address in place of '9027e4ea7bd4' -

$ hdiutil create -size 300g -type SPARSEBUNDLE -fs JHFS+ -volname 'Backup of hollowcore' hollowcore_9027e4ea7bd4.sparsebundle                

Screenshot of MacOSX Connect to Server dialogYou should now mount your Time Machine share through the Finder by clicking Go -> Connect to Server... Entering afp://your-openindiana-hostname-here and then selecting the 'TimeMachine' share. You now need to copy the above Image file that you created to the mounted share.

Screenshot of MacOSX Time MachineYou can now launch TimeMachine, click 'Select Disk', wait for the mounted 'TimeMachine' share to appear and then click 'Use Backup Disk'.

Adam Retter posted on Saturday, 23rd July 2011 at 15.57 (GMT+02:00)
Updated: Saturday, 23rd 2011 at July 15.57 (GMT+02:00)

tags: OpenIndianaMacOSXTime MachineAFPNetatalkAvahiSolaris

3 comments | add comment

Open Indiana Web Hosting

My entic.net Virtual Private Server Migration

I have been hosting my own websites for a couple of years now with a company called Entic.net. Entic.net offer Solaris hosting, by providing full VPS's (Virtual Private Server's) via Solaris Zones technology, they are a great little company with excellent personal support. I am so happy with their service and assistance over the last couple of years, that I really feel I have to sing their praises in public!

I originally started out with Entic.net in mid 2008, when I was looking for affordable Solaris 10 hosting after doing some benchmarking with an eXist-db application and discovering that the best performance was achieved when running atop Solaris 10. Entic.net were at that time able to provide me with a Sun Solaris 10 VPS (curd.entic.net) for just $20 USD/month. Whilst it was located in their US San Jose data center and I am in the UK, I decided that the geographical location did not really matter to me, after all we are both connected to the web!

In June 2009 they assisted me (at no charge!) in migrating to an Open Solaris VPS (well.entic.net) again still at $20 USD/month, for someone who also spends a lot of time in Linux, the move to Open Solaris made server admin much easier - due to the integration of more GNU tools when compared to its predecessor.

As I am an incurable technology junkie, and had been wondering about where to go from Open Solaris now that Oracle have taken over, I contacted Entic.net and enquired about their plans. To my joy I found out that they were already operating some Open Indiana servers and would be more than happy to help me migrate (again at no charge!) if I so wished. I also learnt that Entic.net had expanded and now also have a London data center, and that I could choose to have VPS's located in either.

I jumped at the chance, so Entic.net (well actually, I did it via their self-service web dashboard) setup a new Open Indiana VPS (rama.entic.net), in parallel to my existing VPS and allowed me to migrate in my own time. Entic.net VPS dashboardI decided to locate my new VPS in London, im not sure why, but it felt right. I also took the opportunity to increase the memory available to my VPS, taking the cost from $20/month USD to $31 USD/month total, but thats still cheap! Increasing the memory is again completely automated via their self-service web dashboard, changes take effect within minutes, and without needing to reboot the VPS!

So... I now have my shiny new Open Indiana Web Server up and running, I am of course running eXist-db and Nginx on here, and so far it all seems fast and stable. I may consider a follow up article detailing the steps to setup eXist-db and Nginx on Open Indiana if there is enough interest.

...and, a big thank you to everyone at Entic.net for your excellent service and support, Cheers!

Adam Retter posted on Monday, 22nd November 2010 at 16.39 (GMT+01:00)
Updated: Monday, 22nd 2010 at November 22.16 (GMT+01:00)

tags: Open IndianaOpen SolarisSolarisentic.netwebhosting

2 comments | add comment

Tag Cloud