Copyright © 2003 Kevin Rosenberg
Copyright © 2003 Nate Iverson
Copyright © 2003 Goswin von Brederlow
Copyright © 2004-2006 Frederik Schueler
Copyright © 2004 Hugo Mills
Copyright © 2004 Markus Benning
Copyright © 2005-2006 Roberto Pariset
This manual is free software; you may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
This is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.
A copy of the GNU General Public License is available as
/usr/share/common-licenses/GPL in the Debian
GNU/Linux distribution or on the World Wide Web at the GNU web site.
You can also obtain it by writing to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Table of Contents
Abstract
The purpose of this document is to provide a convenient resource for developers of the AMD64 port of Debian GNU/Linux. Eventually, it may serve as a reference for end users with AMD64 systems. The AMD64 port was originally developed with AMD Opteron processors, but people are now using Athlon64, Athlon64 FX and Intel EM64T "Nocona" processors as well.
This version of the document has been nearly completely rewritten to be more comprehensive and to match once more with the current development direction of the Debian-AMD64 port.
Last Modified: $Id: debian-amd64-howto.xml,v 1.72 2006/09/24 12:20:33 intero-guest Exp $
The debian port for AMD64 and EM64T based systems is, as the name states, thoroughly 64bit.
The porters team made available an unofficial stable release, complete with official security-, volatile and backports support.
The unstable and testing distributions are available in the official Debian GNU/Linux archive.
Pure64 is installable using the Debian-Installer.
For more port specific informations, see the official Debian-amd64 port page at http://www.debian.org/ports/amd64/.
This is confusing, because the name has changed over time. The initial name for the architecture was x86-64. However, around the time of the Opteron launch, AMD stated the name x86-64 ceased to exist and was replaced by the name AMD64. AMD acknowledge that the name x86_64 still exists and is what is reported by the 64-bit Linux kernel for this platform. In a message from AMD's Marc Miller [1], he recommends using the name AMD64 in places where i386 or i686 might be used and use x86_64 in places where x86 may be used.
there are two ways of getting help beyond this HOWTO:
Using Debian-Installer is the preferred installation method for the Debian GNU/Linux distribution, and therefore for the unofficial amd64 port too.
Builds of the installer images for netboot, monolithic, hd-media and cdrom can be found on the /debian-installer directory of each mirror. For example, if your chosen mirror is:
http://ftp.de.debian.org/debian-amd64/
then you will need to append /debian-installer to that path, in order to obtain the following:
http://ftp.de.debian.org/debian-amd64/debian-installer/
A complete list of mirrors can be found at http://amd64.debian.net/README.mirrors.html.
Netinst, businesscard, full CD and DVD set, along with other ISO images can be found at the following locations:
Stable: http://cdimage.debian.org/cdimage/unofficial/sarge-amd64/.
Unstable: it is possible to install the unstable distribution using a netboot method or business card CD image from testing. Please read this FAQ first.
The Debian-Installer documentation for the AMD64 architecture is to be found at http://amd64.debian.net/docs/installmanual/en/; if you have trouble writing the iso images to cd-rw, see this url: http://www.debian.org/CD/faq/.
All general D-I bugs are tracked in the Bug Tracking System.
Before you start bootstrapping the pure64 port into a chroot, make sure you are already running a 64bit kernel, or boot from a Debian-Installer CD in order to accomplish the following steps.
If you already have an existing i386 Debian installation, you can install the amd64 kernels found in the archive.
Create a directory to install the pure64 chroot into. If you want the chroot to be bootable as well, format a spare partition or add a new harddisk for the root of your new pure64 install. Then mount it somewhere, like /pure64.
You can use debootstrap or cdebootstrap. For Sid aka unstable, run:
cdebootstrap --arch amd64 sid /pure64/ http://ftp.debian.org/debian/
or
debootstrap --arch amd64 sid /pure64/ http://ftp.debian.org/debian/
And for Sarge (unofficial mirror required):
cdebootstrap --arch amd64 sarge /pure64/ http://amd64.debian.net/debian-amd64/
or
debootstrap --arch amd64 sarge /pure64/ http://amd64.debian.net/debian-amd64/
You will want to use a mirror faster for you than alioth; see the sources.list section below.
cp /etc/hostname /etc/resolv.conf /etc/network/interfaces /mnt/etcand set up the fstab.
Finally, run:
chroot /pure64
and then:
apt-get install locales
from within it. You will also want to
set up your /etc/apt/sources.list.
A complete list of publically accessible mirrors for your source.list is provided - you might want to check which one is fastest for you, and use that one. You can find this list here: Debian worldwide mirror sites. The unofficial list of mirrors which contains the unofficial AMD64 Sarge release can be found here. This can be useful also for some Etch packages which have not yet been rebuilt in the official archives.
Please mind that since sarge, there are no Non-US binary packages any longer.
Until console-data is fixed, you need to select the keymap from the full list, not from the arch list as is usual. To get the debconf question again, run:
dpkg-reconfigure -plow console-data
and select the appropriate keymap from the list. Or simply install the boot-time keymap by hand:
install-keymap de-latin1-nodeadkeys
or whatever keymap you are used to.
The current amd64 port of debian is a pure 64bit port. This means you can't run binary only programs which are compiled for IA32 or applications which haven't been ported to AMD64 yet (e.g. OpenOffice.org). This is because you can't mix 32bit applications and 64bit libraries. You would also need the 32bit versions of the libraries to run a 32bit application.
This chapter explains how you can run 32bit applications in your 64bit system using the IA32 libs from a IA32 chroot and running IA32 applications inside this chroot, in a way which is mostly transparent to the user.
Please make sure to read all the following sections before actually choosing one way rather than another.
There is already a minimal set of IA32 libraries packaged for use in a 64bit Debian system. Simply type:
apt-get install ia32-libs
and you will be able to run most 32bit binaries within your system.
In other words, you don't need a whole chroot to run quite a few programs:
installing ia32-libs is a solution for most cases.
It is also possible to build 32bit binaries within a 64bit environment. For instance, you can do something like:
gcc -m32 hello.c -o hello
and verify that your Hello World program is 32 bit. Of course, you can also run it.
One last thing: for 32bit programs needing X locales you might also want to
export XLOCALEDIR=/emul/ia32-linux/usr/X11R6/lib/X11/locale
First you need to install a IA32 base system into a chroot. You can do this with the debootstrap command:
debootstrap --arch i386 sid /var/chroot/sid-ia32 http://ftp.debian.org/debian/
To install a few more libraries you can change into this chroot and install/update packages with apt-get:
chroot /var/chroot/sid-ia32 apt-get install libx11-6
To run an application inside the chroot you will need some parts of your
64bit system tree inside the chroot. This can be achieved with a bind
mount. In this example we will bind /tmp to the chroot for
the X11 sockets which are in /tmp, and bind
/home to access the home directories from within the
chroot. You may also want to mount the /dev, /proc and /sys
filesystems within the chroot.
Edit your fstab and add the required paths:
# sid32 chroot /home /var/chroot/sid-ia32/home none bind 0 0 /tmp /var/chroot/sid-ia32/tmp none bind 0 0 /dev /var/chroot/sid-ia32/dev none bind 0 0 /proc /var/chroot/sid-ia32/proc none bind 0 0
Then mount them:
mount /var/chroot/sid-ia32/home mount /var/chroot/sid-ia32/tmp mount /var/chroot/sid-ia32/dev mount /var/chroot/sid-ia32/proc
You will also need to set up the relevant users in the chroot.
Copy your /etc/passwd, /etc/shadow
and /etc/group files to the chroot, or add the
users manually to the passwd/shadow of your chroot.
It is also possible to hard link the files when they are on the same partition.
Just make sure the user exists also in the chroot.
To avoid locale problems you might also want to set up
/etc/environment.
WARNING! Remember that if you bind your home directory and delete your chroot, all your personal data will be lost. So do not forget to umount your home before eventually erasing a chroot.
Please note that if you are using schroot there are chances you can avoid binding directories and copying or hard linking files. Check schroot manpage and modify /etc/schroot/setup.d/10mount to match your needs.
At this point you should be able to run applications within the chroot. Change to your chroot (you must be root to do this):
chroot /var/chroot/sid-ia32
Change to the user under which you want to run the program:
su - zumsel
Set your $DISPLAY:
export DISPLAY=:0
And run something:
openoffice
Of course you must have installed the package inside the chroot for this to work.
There is also an easier way to run applications inside the chroot with the schroot.
Leave the chroot and install the schroot package. schroot allows users to change
into several chroots and run commands inside them.
You must add your chroot to /etc/schroot/schroot.conf to allow users to change into it.
This can be done as follows:
[sid32] description=Debian Sid i386 (sid32) location=/var/chroot/sid-ia32 priority=3 groups=zumsel,root root-groups=root aliases=default,unstable,ia32 personality=linux32 type=plain run-exec-scripts=true run-setup-scripts=true
In this case, /etc/resolv.conf,
/etc/passwd, /etc/shadow
and /etc/group will be copied at each time
a schroot session is started.
On the other hand, you still need to explicitly bind the directories
you need.
Now you should be able to run commands inside the chroot as normal user:
schroot -c sid32 -p openofficeOr, if the [sid32] stanza in your
/etc/schroot/schroot.conf contains aliases=default, you can simply run:
schroot -p openoffice
This will run openoffice in the sid32 chroot you specified in /etc/schroot/schroot.conf.
The option -p preserves the user's environment so you don't have to set DISPLAY or such things
manually.
You can make things slightly simpler even than this.
Write a small shell script like the following, and place it in your PATH,
e.g. /usr/local/bin/do_schroot.
This script can look like the following:
#!/bin/bash exec schroot -p -c sid32 -q -- "`basename $0`" "$@"
Make it executable:
chmod 755 /usr/local/bin/do_schroot
Now create a symlink to this script from each command you want to run inside the chroot to this shell script:
cd /usr/local/bin ln -s do_schroot openoffice ln -s do_schroot oowriter ln -s do_schroot oocalc
Now you can execute openoffice by simply typing openoffice or oowriter.
You can also pass filenames on the command line to openoffice since the paths are the same inside the chroot.
While architectures like sparc64 or powerpc64, which provide lib for default 32bit libraries and lib64 for extra 64bit libraries, default to executing 32bit applications, amd64 defaults to 64bit binaries because of the performance benefits it offers in 64bit mode. Thus, not wanting to rewrite virtually every binary-arch package's creation rules to install libs in lib64 not lib, and wanting to find a solution for all multiarch capable platforms debian supports, various people are working on so-called multiarch support.
All relevant information concerning multiarch is assembled on http://people.debian.org/~taggart/multiarch/.
No. IA64 is Intel's designation for their Itanium architecture. Intel's name for their AMD64-compatible architecture is EM64T (Extended Memory 64 Technology). IA64 systems are a completely different architecture.
It is! Please read this page for information about how to switch to an official mirror, if you haven't done so yet.
The first planned official Debian release of 64bit userland for AMD64 will be Etch (Sarge+1).
The unofficial sarge based on the debian-amd64 port can be found here: http://cdimage.debian.org/cdimage/unofficial/sarge-amd64/. Security updates will be provided by the AMD64 porting team.
Currently, there are 4 distributions available, 2 official and 2 unofficial:
The port is being worked at since the beginning of 2004, and many people use it for both workstations and servers. The stable suite is recommended for servers and workstations, featuring security updates and debian-volatile support.
There are 64bit related problems in approximately 200 packages. Most of these packages will simply fail to build, some of them will cause segmentation violations. Experience shows, however, that the former is more common than the latter. The vast majority of packages with known 64bit problems cannot be built at all.
For most workstations, a 32 bit chroot is still necessary in order to run some common applications, namely OpenOffice.org, WINE, MPlayer with Win32 codecs and Mozilla with Flash. Nonetheless, a growing number of people use these ports on their desktop system, and are really happy with it.
No. You need to reinstall on a newly formatted partition or disk, by either running cdebootstrap / debootstrap from your running installation or using the Debian-Installer.
Running 32bit userland with a 64bit kernel is recommended only for servers needing the absolute stability of 10 years of 32bit debian, but without the memory limitations the IA32 architecture bears, for example a 64bit mysql server on a system with 8GB or 16GB memory.
Running the mixed setup on a workstation is not recommended, because iptables, the XFS filesystem, non-free NVidia and ATI binary drivers do currently not support it.
Mainboards: Every currently available amd64 mainboard should work with pure64; If you want to run sarge on it, you will probably archive the best results with an older VIA or AMD based board, due to the old kernel found in the sarge installer. Nforce4 based boards are likely to not run with the sarge installer, as SIS and ATI boards are neither. You should use the etch installer on those and install the newest kernel from backports.org on those boxes, if you want to run sarge on them. SIS boards are likely to cause the most trouble.
Most network interface cards should work out of the box; nforce4 onboard nics (forcedeth) will not work with the sarge installer, neither will newer Marvell/Yukon (skge) NICs.
Most Sata/scsi/pata drivers should work; the sarge installer does not know about newer nforce4/sis/ati chipsets, so you will probably end without DMA or without disks at all. dpt_i2o scsi hosts are supported using the i2o drivers; newer 3ware 95xx and mpt/fusion need a recent kernel and should be installed too using the etch installer and he latest backports.org kernel.
Make sure the following points apply:
Since apt 0.6 has landed in Debian Unstable, it's now possible to verify if the packages that you install are legitimate. This means that when you download a package apt will verify that the author is who he claims to be and that the package is the same package he uploaded. If the error you get looks like:
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8899AABBCCDDEEFF
then, if you trust the repository, you should download that key and add it to your list of trusted keys, in this way:
# gpg --keyserver subkeys.pgp.net --recv-keys 8899AABBCCDDEEFF # gpg --armor --export 8899AABBCCDDEEFF | apt-key add -
All problems should be solved next time you run apt-get update. You can check if that key is now considered safe with the following command:
apt-key list
The Debian Kernel Team maintains 64bit kernel packages for both i386 and amd64, featuring different kernel flavours for AMD64 and EM64T systems as well as UP and SMP flavours.
Note: The Debian kernels are 64bit, need an initrd, and have IA32 emulation enabled by default.
If you want to compile the kernel yourself, the latest 2.6 kernel is recommended. At least Linux 2.6.5 is need to build a kernel with IA32 emulation using the toolchain from amd64. Also, Athlon 64 X2 (Dual-Core) processors require Linux 2.6.14 or newer. Latest versions are always the best.
Linux 2.4 series kernels are not supported, the system will not boot lacking NPTL suppport.
The NVidia drivers for amd64 are known to work with linux 2.6.5 and newer kernels. The official debian nvidia-graphics-driver packages support amd64, everything works the same way as you might be used to with i386. It is not recommended to install using the NVidia driver installer, because it is based on a different directory layout than the debian amd64 port.
Installing the NVidia drivers is documented in
/usr/share/doc/nvidia-kernel-source/README.Debian
Since the documentation is i386 centristic, these are the short instructions for amd64:
/usr/src/kernel-headers-2.6.8-11-amd64-k8 (or whatever
headers you installed) after you unpacked the nvidia-kernel-source tarball
in /usr/src and run:
make-kpkg modules_imageor, if you are using Sarge:
MAKEFLAGS="CC=gcc-3.4" make-kpkg modules_image
Sarge users please note also that there's an available linux 2.6.15 kernel built with gcc-3.3 available at backports.org. In other words you won't need to use gcc-3.4 as stated before, if you use that kernel.
Please also note that using a 64 bit kernel with a 32 bit userland won't let NVidia drivers work properly.
Old ati radeon cards up to the 9200 model are mostly supported by the free GLX drivers in XFree86.
For newer cards (unfortunately except the X1x00 series), ATI has released its fglrx drivers for amd64. See the mailing list archive starting at Jan. 2005 for informations. There are no prebuilt debian packages available in the unofficial amd64 archive, but the package sources already do support it. However, there's an unofficial repository available at the Fabio Stanchina's page.
Most wavelan cards with native linux support do work in a 64bit kernel too. If your card is not supported by Linux directly, you might need to setup ndiswrapper. See the corresponding Documentation of that package.
No. If you really need to access such webpages, install mozilla and flashplugin-nonfree in your 386 chroot and use the 32bit browser to access the sites.
You probably need the any-any patch found
here. It is a file named like
vmware-any-any-update101.tar.gz; extract it and run
runme.pl.
If you are running an old VMware version with a recent (2.6.12+) kernel, you may need to run (as root) the following:
echo "#include <linux/ioctl32.h>" > /lib/modules/`uname -r`/build/include/asm/ioctl32.h
In general, all bugs concerning a debian package should be reported to the Debian Bug Tracking System (BTS), whether they are amd64 only or not. If you can reproduce the very same bug on another, officially supported debian architecture, even better.
Typically, bugs showing up in the amd64 ports are general unstable bugs, concerning all supported architectures. You can verify this by checking the BTS, often the very same bug was already reported by someone else for some other architecture.
If you encounter a bug not listed in the BTS, please report it. If you think this is a 64bit bug or an amd64-only issue, please send a copy to the mailing list using the X-Debbugs-CC: header. See http://www.debian.org/Bugs/Reporting for details on how to report bugs to the BTS.