Unix

How-To: Fix “The file server has closed down” issues in Mac OS and netatalk

Netatalk versions older than 2.1.3 had some issues with the TCP/IP Stack on Linux which resulted in errors like

Luckily they seem to have fixed this in 2.1.3 as the ChangeLog states: fix a serious error in networking IO code.

So the solution is as easy as upgrading. I am running Ubuntu, but two months after netatalk-2.1.3 has been released, they don’t even have it in unstable. Lucky Gentoo users you! I needed to fix this very quickly as it started to disrupt my workflow. Sadly I currently don’t have the time to dig into the packaging system of Debian or Ubuntu, so I looked up Debian’s configure options and just compiled from source:

cp -a /etc/netatalk/ ~
aptitude purge netatalk
apt-get build-dep netatalk
wget http://sourceforge.net/projects/netatalk/files/netatalk/2.1.3/netatalk-2.1.3.tar.bz2/download
tar xjvf netatalk-2.1.3.tar.bz2
cd netatalk-2.1.3
./configure  --with-shadow --enable-fhs --enable-tcp-wrappers --enable-timelord --enable-overwrite --with-pkgconfdir=/etc/netatalk --enable-krb4-uam --enable-krbV-uam --with-cnid-dbd-txn --with-libgcrypt-dir --with-cracklib=/var/cache/cracklib/cracklib_dict --enable-debian --disable-srvloc --enable-zeroconf --with-ssl-dir --enable-pgp-uam --prefix=/usr/local/netatalk/
make
sudo make install
mv ~/netatalk /etc/
/etc/init.d/netatalk start

This saves a copy of your running netatalk configuration to your home directory, removes netatalk, downloads all necessary libraries to build netatalk, downloads netatalk from SourceForge, extracts it, configures it, builds it, installs it, restores the configuration and starts it as usual.

I am running netatalk 2.1.3 for a week now and the error seems to be gone :-)

If you know how to easily create a Debian package, feel free to post in the comments.

My Mac OS X tweaks

Ohhh nooo! Not another one! However… :-) I’ll make it short:

  • Use TinkerTool to tweak some hidden preferences
  • iTerm is a better alternative to Terminal.app
  • NTFS-3G if you have usb-sticks or external HDDs you want to share with Windows or Linux
  • MacVim is my favorite editor for anything
  • The Unarchiver is great for compressed stuff you downloaded
  • VLC… forget QuickTime X, VLC does more things better
  • Evernote takes your notes and synchronizes them
  • Dropbox (link gives my account additional 250Mb) synchronizes your documents with multiple computers

I also enable SSH (System Preferences/Sharing), change the default icon size to 48×48 and install Xcode and MacPorts to get mtr (an interactive traceroute) and unrar (for things ‘The Unarchiver’ doesn’t take).

How-To: Fast VNC alternativ to Remote Desktop to a Mac using NoMachine

I am a very happy Mac OS user with a Mac mini and a MacBook Pro coming soon, but one things I really miss about Mac OS X is the lack of a fast and standards based remote desktop solution. The VNC server built into Mac OS X isn’t really compatible with all clients, and I still haven’t figured out if it’s possible to run it with a different resolution and color depth than the real screen!!!

But, I recently re-discovered a solution I got to know in my Linux time on a desktop: NoMachine. You’ll need a server running a recent Linux distribution or OpenSolaris which will act as a kind of a proxy and the setup is a bit complex, but it does work well. I’ll show you how to do it running Ubuntu Lucid.

First go to http://www.nomachine.com/select-package.php?os=linux&id=1 select your architecture and download all three files: client, node and server.

Then install them in the following order, fix the missing dependecies and install a vnclient plus vncpassword:

sudo dpkg -i nxclient_3.4.0-7_x86_64.deb
sudo dpkg -i nxnode_3.4.0-11_x86_64.deb
sudo dpkg -i nxserver_3.4.0-12_x86_64.deb
sudo aptitude -f install
sudo aptitude install xvnc4viewer vnc4-common

Since it’s really advisable I hope you already have PasswordAuthentication no in your sshd_config to disable Password authentication and to only allow key-based authentication. You’ll need to tweak nxserver a bit to get it working with key-based auth. Edit /usr/NX/etc/server.cfg to…

EnablePasswordDB = "1"

…edit the following line in /usr/NX/etc/node.cfg to enable VNC…

CommandStartRFB = "/usr/bin/vncviewer -fullscreen"

…create a key for your key-based authentication and restart nxserver.

sudo /usr/NX/bin/nxserver --keygen
sudo service nxserver restart

Your new key is placed at /usr/NX/share/keys/default.id_dsa.key. Copy it the device you want to connect from using scp or similar tools. Now all you need to do is enable the users you wan’t in nxserver:

sudo /usr/NX/bin/nxserver --useradd <user>

This enables the user in NX’s database and copies the previously generated key to the user’s authorized_keys file.

Now just enable VNC on your Mac. Go to “System Preferences”, select “Sharing” and enable “Screen Sharing”:

Now you’ll need to configure your client. Read more…

How-To: Setup KVM on Ubuntu Lucid

More than a year ago I wrote an article about Xen on Ubuntu Intrepid with the intention of blaming Ubuntu. I also clearly said, that I wouldn’t use Ubuntu anymore. This article turned out to be the most hit one on my blog. Maybe because the Ubuntu community directly links to it. Then, last Summer I wrote an article about alternatives to Xen, but I decided to wait and stay with Xen on my homeserver in the meantime. (Please keep in mind, all I use this for is for my private setups!). Last week I upgraded my Server’s hardware and also wanted to re-install it.

Xen still hasn’t made it into vanilla Kernel, it might make it into 2.6.34 or .35, but even if it does, I think it’s not even going to be close to being production ready. Plus most distributions release their next version in the next weeks/months and are already frozen, so they definitely will not ship with Xen. Well, the only real alternative is KVM. I didn’t like the idea of using KVM for a long time, but since almost every distribution now features KVM as their virtualization technique, I went with it. I also went with Ubuntu again (yeah blame me!). Why? Because their next release has long-term support, and I won’t have the time to upgrade it in the next 12-18 months. And what shall I say… I like it. Installation was kinda tricky on a software Raid0, but I was installing a development release, 1 week before the first Beta… and in the end it did work.

The server runs KVM now and it runs fast and stable. I have 4 virtual machines on it now. Installation of the guests using virt-installer and/or ubuntu-vm-builder was much easier and ended up with working VMs out of the box, whereas xen-create-image ended up with an unusable image on Intrepid, because the default console never showed up without tweaks. libvirt is also nice if you need it, but I really want to point out, that you can run KVM without libvirt just with the ‘kvm’ command!

I tagged this article ‘How-To’, but there are already many good KVM guides out there so I won’t write yet another one. I’ll just post a few hints to get KVM running with a bridged networking using libvirt.

First of all I removed /etc/libvirt/qemu/networks/default.xml to disable the dnsmasq features of libvirt. Then I created an LVM volume group where I wanted to place my machines at, but you can also use simple images on your filesystem. The next thing I did was setting up a bridge in /etc/network/interfaces:

auto br1
iface br1 inet dhcp
        bridge_ports eth1
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0

You can now simply create your virtual machine with this command:

virt-install -n $hostname -r 512 -c /home/shared/apps/os/ubuntu/lucid-server-amd64.iso --disk path=/dev/virtdisks/bender --network bridge=br1 --vnc --vnclisten=0.0.0.0 --noautoconsole --os-type linux --os-variant ubuntuLucid --accelerate

Now connect to your host using VNC and install as usual. Another way is to use ‘ubuntu-vm-builder’, but I simply didn’t try… Make sure you limit VNC access to localhost in /etc/libvirt/qemu/$hostname.xml after installation if your network is unsecure.

To make your domain autostart on boot use:

virsh autostart $hostname

This will copy the appropriate xml configuration file to /etc/libvirt/qemu/autostart/.

It’s as simple as that. Way easier than patching a kernel for Xen and all these things. I would have really loved to see Xen in vanilla Kernel a year ago or so, but it didn’t happen and KVM works well enough for me by now… plus you have the benefit of a working power-management.

Take care.

How-To: OpenVPN on OpenBSD as Layer2 VPN

Getting OpenVPN running on a recent OpenBSD pretty simple. I run OpenVPN 2.1 on OpenBSD-current as of 2010/03/10 (almost 4.7) with PSK as a layer2 VPN. Layer2 because I have some zeroconf/bonjour stuff running at my LAN and I want to connect to my iTunes shares through the VPN. I’ll make it very short: Install OpenVPN from packages (or ports if you want to), configure a bridge, create a PSK and create a simple config file.

pkg_add http://ftp.openbsd.org/pub/OpenBSD/4.7/packages/amd64/openvpn-2.1.0.tgz
ifconfig tun0 create
ifconfig bridge0 create add fxp0 tun0
openvpn --genkey --secret /etc/openvpn/server.key

Paste this to /etc/openvpn/server.conf:

proto tcp-server
port 1194
dev tun0
dev-type tap
secret /etc/openvpn/server.key
push "route 10.1.0.0 255.255.0.0 10.1.16.1"
persist-key
persist-tun
ping-timer-rem
keepalive 10 60
user _openvpn
group _openvpn

To make OpenVPN start on boot create /etc/hostname.bridge0 with:

add fxp0
add tun0
up

And /etc/hostname.tun0 with: (I had to set link0 to get it working)

up link0
!/usr/local/sbin/openvpn --daemon --config /etc/openvpn/server.conf

That’s it. You can reboot to test if it’s working or just run OpenVPN with

/usr/local/sbin/openvpn --daemon --config /etc/openvpn/server.conf

A simple client configuration would look like:

proto tcp-client
dev tap
remote you.example.org 1194
secret ./your.key
persist-key
persist-tun
ping-timer-rem
keepalive 10 60

Hint: Use DynDNS or something similar to use OpenVPN with a dynamically assigned IP-Address.

How-To: Setup Ubuntu Lucid as a TimeMachine Server

I think starting with Lucid, Ubuntu ships netatalk 2.0.5 which makes setting up Linux as a TimeMachine server much easier. You no longer have to compile on you own nor do you have to create the sparsebundle.

Just install netatalk and avahi-daemon if you want to, add options:tm to AppleVolumes.default and you’re done.

aptitude install netatalk
echo /home/shared/timemachine  "TM" options:tm >> /etc/netatalk/AppleVolumes.default

If you want the service to be advertised on your LAN also install avahi-daemon and create /etc/avahi/services/afpd.service with this content:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!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-group>

Now you have to point TimeMachine to the TM share and that’s it. As long as you have a server with enough free space running at you LAN that saved you a lot of bucks compared to buying a TimeCapsule.

OpenBSD on the Intel D410PT

Recently my gateway died. I not even had to replace the cf-card, but the entire unit. The old Intel D945GCLF2 just was unstable after the outtage. Last year Intel came up with some nicer layouts of their Atom boards and they now have totally fanless and pretty green devices. I bought the Intel D410PT because it’s cheap (around 60€), fanless and doesn’t need much energy.

Assembled with PicoPSU-90, 1Gb of DDR2-800 RAM, a CF-to-SATA adapter, a 4Gb SanDisk UltraII and a dual-port Intel FastE nic, I installed OpenBSD-current as of 2010/03/09 (aka 4.7) to it.

To cool this thing I added two 40mm fans to the right of the board, cooling the PSU and the chipsets.

Sensors:

hw.machine=amd64
hw.model=Intel(R) Atom(TM) CPU D410 @ 1.66GHz
hw.ncpu=2
hw.byteorder=1234
hw.pagesize=4096
hw.disknames=sd0
hw.diskcount=1
hw.sensors.cpu0.temp0=57.00 degC
hw.sensors.cpu1.temp0=57.00 degC
hw.sensors.lm1.temp0=42.00 degC
hw.sensors.lm1.temp1=48.00 degC
hw.sensors.lm1.fan0=1687 RPM
hw.sensors.lm1.volt0=1.17 VDC (VCore)
hw.sensors.lm1.volt1=3.95 VDC (+12V)
hw.sensors.lm1.volt2=1.92 VDC (+3.3V)
hw.sensors.lm1.volt3=5.04 VDC (+5V)
hw.sensors.lm1.volt4=2.45 VDC (-12V)
hw.sensors.lm1.volt5=5.07 VDC (5VSB)
hw.sensors.lm1.volt6=0.05 VDC (VBAT)
hw.cpuspeed=1666
hw.vendor=Intel Corporation
hw.product=D410PT
hw.uuid=c197189c-d5c3-11de-914c-000000000000
hw.physmem=1054441472
hw.usermem=1054363648
hw.ncpufound=2

Dmesg:

OpenBSD 4.7 (GENERIC.MP) #128: Tue Mar  9 09:54:33 MST 2010
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 1054441472 (1005MB)
avail mem = 1014898688 (967MB)
RTC BIOS diagnostic error 80<clock_battery>
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.5 @ 0xe0100 (24 entries)
bios0: vendor Intel Corp. version "MOPNV10N.86A.0159.2010.0104.1040" date 01/04/2010
bios0: Intel Corporation D410PT
acpi0 at bios0: rev 2
acpi0: tables DSDT FACP APIC MCFG HPET SSDT
acpi0: wakeup devices SLPB(S4) PS2M(S4) PS2K(S4) UAR1(S4) UAR2(S4) P32_(S4) ILAN(S4) PEX0(S4) PEX1(S4) PEX2(S4) PEX3(S4) UHC1(S3) UHC2(S3) UHC3(S3) UHC4(S3) EHCI(S3) AZAL(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Atom(TM) CPU D410 @ 1.66GHz, 1666.99 MHz
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,TM2,CX16,xTPR,NXE,LONG
cpu0: 512KB 64b/line 8-way L2 cache
cpu0: apic clock running at 166MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Atom(TM) CPU D410 @ 1.66GHz, 1666.69 MHz
cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,TM2,CX16,xTPR,NXE,LONG
cpu1: 512KB 64b/line 8-way L2 cache
ioapic0 at mainbus0: apid 8 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 8
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 5 (P32_)
acpiprt1 at acpi0: bus 0 (PCI0)
acpiprt2 at acpi0: bus 1 (PEX0)
acpiprt3 at acpi0: bus 2 (PEX1)
acpiprt4 at acpi0: bus 3 (PEX2)
acpiprt5 at acpi0: bus 4 (PEX3)
acpicpu0 at acpi0: C1, PSS
acpicpu1 at acpi0: C1, PSS
acpibtn0 at acpi0: SLPB
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Pineview DMI Bridge" rev 0x00
vga1 at pci0 dev 2 function 0 "Intel Pineview Integrated Graphics Controller" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp at vga1 not configured
ppb0 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x01: apic 8 int 17 (irq 255)
pci1 at ppb0 bus 1
re0 at pci1 dev 0 function 0 "Realtek 8101E" rev 0x02: RTL8102EL (0x2480), apic 8 int 16 (irq 11), address 00:27:0e:05:12:ca
rlphy0 at re0 phy 7: RTL8201L 10/100 PHY, rev. 1
ppb1 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x01: apic 8 int 16 (irq 255)
pci2 at ppb1 bus 2
ppb2 at pci0 dev 28 function 2 "Intel 82801GB PCIE" rev 0x01: apic 8 int 18 (irq 255)
pci3 at ppb2 bus 3
ppb3 at pci0 dev 28 function 3 "Intel 82801GB PCIE" rev 0x01: apic 8 int 19 (irq 255)
pci4 at ppb3 bus 4
uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x01: apic 8 int 23 (irq 9)
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x01: apic 8 int 19 (irq 10)
uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x01: apic 8 int 18 (irq 11)
uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x01: apic 8 int 16 (irq 11)
ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x01: apic 8 int 23 (irq 9)
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb4 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xe1
pci5 at ppb4 bus 5
ppb5 at pci5 dev 0 function 0 "DEC 21154 PCI-PCI" rev 0x02
pci6 at ppb5 bus 6
fxp0 at pci6 dev 4 function 0 "Intel 8255x" rev 0x05, i82558: apic 8 int 21 (irq 9), address 00:50:8b:95:a4:d2
inphy0 at fxp0 phy 1: i82555 10/100 PHY, rev. 0
fxp1 at pci6 dev 5 function 0 "Intel 8255x" rev 0x05, i82558: apic 8 int 22 (irq 10), address 00:50:8b:95:a4:d3
inphy1 at fxp1 phy 1: i82555 10/100 PHY, rev. 0
pcib0 at pci0 dev 31 function 0 "Intel Tigerpoint LPC Controller" rev 0x01
ahci0 at pci0 dev 31 function 2 "Intel 82801GR AHCI" rev 0x01: apic 8 int 19 (irq 10), AHCI 1.1
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: <ATA, SanDisk SDCFH2-0, HDX> SCSI3 0/direct fixed
sd0: 3919MB, 512 bytes/sec, 8027712 sec total
ichiic0 at pci0 dev 31 function 3 "Intel 82801GB SMBus" rev 0x01: apic 8 int 19 (irq 10)
iic0 at ichiic0
spdmem0 at iic0 addr 0x51: 1GB DDR2 SDRAM non-parity PC2-6400CL5
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
wbsio0 at isa0 port 0x4e/2: W83627THF rev 0x84
lm1 at wbsio0 port 0x290/8: W83627THF
mtrr: Pentium Pro MTRR support
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
root on sd0a swap on sd0b dump on sd0b

2009’s Virtualization Techniques Compared

Hi folks, before we get started a small explanation of my setup and why I want to replace it.
My small home server runs Xen 3.3 with Ubuntu Intrepid, a Debian Xen kernel and the guests on LVM devices. Guest OSs vary from Debian over Solaris to Windows. I built the server last year, but sadly I’m already running out of HDD space and want to upgrade soon. I also want to re-install the Dom0 because Intrepid doesn’t run very well: USB doesn’t work with all devices, there are some bugs in the start-up scripts and I have trouble with the ttys.
A lot has changed since I last fiddled with virtualization so I used this weeks bad weather to compare the current status of all those virtualization systems.
Because there are so many different needs, there are many specialized solutions for desktop and server virtualization. Open-Source, free or commercial ones.

I use VirtualBox on my workstation because it’s free, fast, easy to use and runs very very well. I’ve used the VMware products earlier on Linux and Windows until they became too feature-rich, slow and sometimes even buggy for me. But this post is not about desktop virtualization, it’s about open-source (or free) server virtualization.

VMware Server, VMware ESXi, Microsoft Hyper-V, VirtualBox, Xen and KVM are the ones I’ve tried. There is also Virtuozzo, OpenVZ, UML and so on, but these are more like chroots on steroids. Continue reading to see what I liked and what I didn’t like about them.

Read more…

help.ubuntu.com links to my blog

I was just comparing the current status of KVM, Xen and some other virtualization techniques when I came across the Ubuntu Help for Xen. The page states that Ubuntu still doesn’t provide a Xen Dom0 Kernel in their latest release, but that doesn’t surprise me becaus Xen still didn’t make it into the official Kernel… maybe because everyone loves KVM that much. But they link you to a blog post which shows how to run Xen on Ubuntu anyhow.

Noticed it? Yes that’s my article. I was really surprised to see a link to my actually pretty provocative article on an Ubuntu site. They could have also linked to bderzhavets article.

So… that’s it for now. I’ll continue comparing virtualization techniques with the help of debian-user-german and will hopefully begin with the reinstallation of my xen host.

Linux hates me!

I started using Linux back in 2004 with SuSE Linux 9.0 and I liked it. When I upgraded to 9.1 (or 10.0? don’t know…) I got a bit disappointed, which is why I switched the distro. I installed Debian Stable (Sarge at that time), but I found the KDE version coming with Debian Sarge to be pretty old (or older than the SuSE 9.0 ones…I have versionitis you know), which is why I upgraded to SID.  I knew that SID isn’t meant to run on production systems, but I got tired of the dependency problems ‘n stuff pretty soon… I then installed Gentoo on my Desktop and kept Debian Stable on my server which worked very well for more than two years. I mean… first time installation of Gentoo was a pain in the ass on my AMD Athlon XP 1800+ and upgrades (especially KDE upgrades) were annoying, but the system ran well and the rolling-updates were cool. I also learned a lot about the Linux internals like the kernel itself, using command line and editing config files… all the basic stuff which helped me quite a lot with OpenBSD and MacOS later on.

Everything worked well until I got p*ssed off by the compiling times. So I upgraded the hardware to a Quad-Core CPU and 8Gb RAM and installed Gentoo AMD64. Maybe that was a mistake: Flash didn’t work without hacks, Java browser plugin didn’t work, KDE applications crashed more often than on the old installation, GUI applications felt sluggish and the compiling times were not as good as I expected them to be (never figured out why).

Stop reading now if you don’t want to hear me bitching!

Read more…

Christian KildauHi, my name is Chris. I am a wannabe photog, traveler & geek that is again a student and lives in Hesse, Germany. more about me...

PayPal - The safer, easier way to pay online!
Please consider supporting me


enjoyyourcamera.com


Advertise here Advertise here Advertise here Advertise here
Nikon-Blogger-Linkring :: powered by KLUGERD Photo Blogs Blogs - Blog Catalog Blog Directory Photoblogs.org - The Photoblogging Resource blogarama - the blog directory