Setting up GC-Linux with NFS

From gc-linux

Jump to: navigation, search

originally written by Isobel and Steve_-, wikified by Stonebone



zImage-nfs.dol works on the following test environment:

           |                      |
           |                      |
    +------+-------+       +------+-------+
    | NFS Server   |       | GameCube     |
    | |       | |
    +--------------+       +--------------+

The file can be hex-edited if want other addresses. Find for example ip= and edit. It can also be replaced by ip=dhcp (pad with spaces).

Setting Up the NFS Server

The nfs server must be configured to export the /nfsroot/cube directory like in the following /etc/exports file:


Remember to execute the command exportfs with the -a option

exportfs -a

To get started, download a 22 MB Debian base system image. Dump it over /nfsroot/cube.

Edit the file /nfsroot/cube/etc/fstab. Replace the IP and path (currently serverIp:fullNfsrootPath) with your servers IP and path. (

You may also want to edit /nfsroot/cube/etc/resolv.conf to let linux use the right nameserver.

Getting Started on the Gamecube

Now try to boot the cube. Assuming everything went ok, you see a booted debian base system waiting for you to log in. If you have a keyboard you should be able to do this. For those who don't have a keyboard, an ssh daemon is installed. The password for root is: cube.

Since the Gamecube only has 24MB of ram, adding some swap space would be nice.

Swap Option 1: ARAM

There is also a second ram called aram which can be used for this purpose. If /dev/aram doesn't exist you need to create it with:

# mknod /dev/aram b 37 0

Then to activate the swap run:

# mkswap /dev/aram
# swapon /dev/aram

Swap Option 2: NBD Swap

Another option is to setup a NBD swap space on the server your doing the NFS mount from.

This can be used to create a 256 meg swap file at /nfsroot/cube/var/swap-gc

# dd if=/dev/zero of=/nfsroot/cube/var/swap-gc bs=$((1024*1024)) count=256

Then, install and start the NBD server on a port of your choice.

# sudo apt-get install nbd-server
# nbd-server  55321 /media/cube/var/swap-gc

This will run the NBD server on port 55321

The NBD client is installed in /root of the debian-sid base install for the cube. Start the client like this:

# mknod /dev/nd0 b 43 0
# /root/nbd-client SERVER 55321 /dev/nd0
# mkswap /dev/nd0
# swapon /dev/nd0

Please note that you have to do these commands (mknod, nbd-client, mkswap, and swapon) every time you boot. It might be a good idea to add something in the startup scripts. One way of doing this is to create the file /nfsroot/cube/etc/init.d/local, put the commands in there. By running the following command (on the cube) makes this file is run at every boot:

# update-rc.d local defaults

Next, you need to configure the debian base system. Run the following command:

# base-config

You're asked a few questions which you have to answer. Be sure to have NBD swap enabled for anything related to package lists, or you will have several areas that crash when trying to do this.

Now the date needs to be set. See the man-page of date to do it by hand. As an alternative, you might also want to take a look at the package ntpdate (to install it: apt-get install ntpdate).

Now you want to upgrade everything to the latest version

# apt-get upgrade

You may run into a problem that it wants to remove an essential package. To get around this, you need to run the command with

# apt-get -o APT::ForceLoopBreak=1 upgrade

Now if you haven't set up NTP, you better do so now. PAM will not let you ssh into the cube on your next reboot if it finds a timestamp significantly newer then the time of the clock.

# apt-get install ntpdate
Personal tools