Contents
TODO
This is a draft article but may be somebody will find it useful.
I was able to get at least running Gnome 3 without visual defects.
Actually there should be performed much more work to get it work better.
My TODO list includes:
– tune touchpad!!!
– better power management
– media keys
– auto dim keyboard light
– auto dim screen light
– hdmi, hdmi audio
– test all peripheral ports
– test stereo mic
– test sound quality
– test audio port to work with apple headset (audio + mic)
– sleep, hibernate
– test mouse device
– test bluetooth
– test wireless
Configure portage
Firstly we need to let portage know details about video card and input devices and that we also would like to build all future packages with support of X server.
nano /etc/portage/make.conf
USE="... X ..."
INPUT_DEVICES="evdev mtrack"
VIDEO_CARDS="intel"
Configure kernel
Run genkernel all --menuconfig
to fix kernel settings and rebuild kernel.
Sometimes genkernel all --menuconfig --no-clean
could save a lot of time if you already have compiled kernel and just would like to enable a few modules.
Device Drivers --->
Input device support --->
<*> Event interface
Graphics support --->
<*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->
<*> Intel 8xx/9xx/G3x/G4x/HD Graphics
[*] Enable modesetting on intel by default
Configure X
The config below will allow you to run X server and Gnome 3 on MacBook Pro Retina.
The config below have:
– touchpad configuration (still not perfect)
– english/russian keyboard
– ctrl+alt+bksp enabled to kill X server
– 286 179
is the screen size (in mm) for 13 inch screen, for 15 inch screen please use 366 203
. Calculation is very simple: (2880 / 200 * 25.4) (1800 / 200 * 25.4)
, where 2880×1800 is resolutions, 200 is density in pixels per inch, 1 inch = 25.4 mm
– 2560x1600
is the screen resolution for 13 inch screen, for 15 inch screen please use 2880x1800
nano /etc/X11/xorg.conf
#Section "InputDevice"
# Identifier "Mouse0"
# Driver "mouse"
# Option "Protocol"
# Option "Device" "/dev/input/mice"
# Option "Emulate3Buttons" "no"
# Option "ZAxisMapping" "4 5"
#EndSection
Section "InputClass"
Identifier "Touchpad0"
MatchIsTouchpad "on"
Driver "mtrack"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
#MatchIsKeyboard "on"
#Driver "kbd"
Driver "evdev"
Option "XkbLayout" "us,ru"
Option "XkbModel" "Apple MacBook Keyboard"
Option "XkbRules" "xorg"
Option "XkbOptions" "grp:alt_shift_toggle,grp:switch,grp_led:scroll,compose:rwin,terminate:ctrl_alt_bksp"
Option "XkbVariant" ",qwerty"
EndSection
Section "Monitor"
Identifier "Monitor0"
DisplaySize 286 179
EndSection
Section "Device"
Identifier "Device0"
Driver "intel"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
SubSection "Display"
Depth 24
Modes "2560x1600"
EndSubSection
Option "PreferredMode" "2560x1600"
EndSection
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
#InputDevice "Mouse0" "CorePointer"
#InputDevice "Touchpad0" "CorePointer"
EndSection
Emerge X server and related drivers:
emerge x11-base/xorg-server x11-base/xorg-drivers
We need to temporary merge twm
, xterm
, xclock
without writing into world to test it if we configure it well.
emerge twm xterm xclock -1
Test xorg server:
startx
If everything is well then you should be able to see twm window manager, xterm and xclock (very small).
To terminate X session login over ssh and kill xorg server (if ctrl+alt+bksp doesn’t work):
pkill X
twm xterm xclock will be removed on next emerge --depclean
Good now we should have working x server.
Rebuild world
We are targeting to systemd/gnome 3 based system so we need to switch gentoo profile to simplify configuration.
eselect profile list
eselect profile set default/linux/amd64/13.0/desktop/gnome/systemd
Rebuild world:
emerge --deep --update --newuse world
Install Gnome
emerge gnome
In my case I have to change some use flags to merge Gnome:
nano /etc/portage/package.use/gnome
>=media-plugins/grilo-plugins-0.2.14 upnp-av
>=gnome-base/gnome-control-center-3.16.3 networkmanager
>=www-servers/apache-2.2.31 apache2_mpms_prefork
Add user
If you didn’t add user previously then add it now.
Add new admin user
useradd -G adm -m username
Set password for user:
passwd username
Or make account passwordless:
passwd -d username
Activate Gnome
We need to switch to gnome X session:
echo XSESSION="Gnome" > /etc/env.d/90xsession
env-update && source /etc/profile
Then test if it works:
startx
You should see Gnome desktop.
Exit from Gnome.
Now if everything is good we could add Gnome to auto start:
systemctl enable gdm
Reboot and you will get automatic prompt for username and password and will be able to log into gnome desktop environment.
Hello friend,
I followed exactly your directions. Everything is ok but …. server X does not work.
I always get “file xauthority.xxx does not exist” screen not found.
I’ve tried with and without xorg.conf. Nothing to do.
Can you help me?
Thanks
Post your xorg conf, log and /var/lib/portage/world to pastebin and publish links here. I will try.
First of all thanks for answering.
I’ve found the issue. It is systemd.
If I start wiping unit systemd X server starts.
Whith systemd black screen.
I’ have also installed nvidia drivers. Now I’m trying to install gnome. But issue stands…
May be it’s nvidia-related issue. There should be a different kernel configuration for nvidia MacBook Pro.
Hi Artem,
thank you for this great tutorial. Hope to see more from you 🙂
I’m just curious – I’m currently learning how to work with Gentoo and mostly play around in a VirtualBox Environment, but plan on installing it on my MBP soon. Question is – do you have any issues with mtrack for the Touchpad? As far as I know, Gnome 3 now uses libinput as default driver. I had issues with that on Arch Linux, because I was using the synaptics driver. However, I have no experience with mtrack. Do you consider it stable?
Also, would be cool if you could show us how to deal with HiDPi issues on the Macbook. I try to use AMAP Gnome Applications, but there are still Qt Apps (e.g. Skype) which look sh*tty on my display (I use Arch). Maybe we could link all Qt Apps against Qt 5.6, because it seems to solve HiDPi problems.
Anyway, thank you for your help again 🙂
I published a brief manual how Gentoo could be installed on MBP. Unfortunately there are others things which should be tweaked to work well. They are not covered because I didn’t find time to play more with it. I mostly use gentoo on servers. I found that OS X eats more resources than gentoo + gnome 3 and also I found that gentoo is more stable.
HiDPI issues should be fixed with setting correct X.org server dpi. At least I got gentoo with good fonts after installation. May be some applications doesn’t work well, not sure.
I found that mtrack works good with apple touchpad and I didn’t see any negative side effects, so I consider it stable.
Not sure if my notes are helpful but anyway good luck in playing with Gentoo 😉
Yeah, HiDPi isn’t an problem with GNOME and GTK-based programs. It’s rather a Qt-specific issue. Well, thank you again for your kind response. Gentoo turned out to be not that difficult to install and use.
Oh, and thank you for the great tutorial on setting good-looking fonts, it helped me a lot 🙂
Hi Artem,
I’ve an error when I want to “startx” : (EE) No devices detected (EE) No screens found
I’ve a MacBook Pro 11.2 Retina 15″ (Late 2013) with intel IRIS Pro Graphics (probably 5200), and no NVIDIA Card.
I’ve follow the part 1 of your article.
Any idea ?
Thanks a lot for your help ! (sorry for my bad english)
Here is my /var/lib/portage/world http://pastebin.com/056BJwBH
Xorg.conf : http://pastebin.com/1WVPN71z
Log Xorg : http://pastebin.com/0UYaZfsJ
no screen found , it’s a problem with osx (my mbp is a 11.3 Intel Iris pro and Nividia. could you try this:
get gxfcard VEr 2.2.1 only -> install on mac , boot on osx active only intel card.
boot on linux -> start x
if no screen found , you do take gpu-switch to active INTEL IRIS card, do a gpu-switch -i (need probably remount de part in rw mode ) ,reboot start x and it’s working.
I have too gentoo on my mbp, but with this Intel and Nivia it’s a fucking pain. Boot osx active only intel, restart boot on gentoo, gpu-switch , reboot , end startx works….