Dell XPS 13 9360 - Late 2017 8th Gen CPU (in Progress)

[General warning, this isn't a newbie or step-by-step instruction on how to do this. If you follow this blindly or don't know what a command does you might wipe something value on your system]

Background

I love my Sager monster laptop but with a current draw of 130W, I can't plug into a car or air plane electrical outlet.
And only 1 hour per battery makes long flights a real chore as shutting down mid-operation is a pain.

So I decided to get a new very portable laptop for coding and perhaps a little light gaming, but most importantly chargeable on a plane or in a car.
I looked around and read a lot and ended up deciding to go with the Dell XPS 13.
The reviews helped but more importantly Dell supported Linux out of the box.
I started monitoring the prices and watching for any kind of deal on an XPS 13 Developer Edition.

Then Dell threw me a curve, Dell updated the 9360 to use the (oddly?) named 8th generation CPU with more cores buy lower base clock.
Considering this was a going to be a box I planned to do development on, the extra cores were a great add and the lower power consumption was nice too.

Then disappointment, the 8th gen XPS 13 was listed in a few places but never in the Developer Edition.
I considered waiting but then Dell put the XPS 13 on an early Black Friday sale.
Crap.
Not knowing how long it would take for the 8th gen to filter down to the Developer Edition and not wanting to miss the sale, I bought the standard version.
Sadly it is infected with microsoft software.
I do feel hypocritical and realize that I'm contributing to the problem. I bought the microsoft version of the XPS 13 and now I've added to that statistic at Dell even though I won't be running microsoft on it other than the initial steps to update BIOS et. al.




Installing Xubuntu

Now on to the fun, getting this thing usable with my current OS of choice: Xubuntu.

For some other experiences, I used this blog entry:
http://mattsumme.rs/2017/dell-xps-13-9360-setup/
for some XPS 13 specific information.

Step 1: Try to make a binary backup of the shipped HD.
Downloaded the latest Xubuntu amd64 image.
Wrote it to a USB memory stick:
sudo dd if=xubuntu-16.04.3-desktop-amd64.iso of=/dev/sdf bs=8M

Next I booted the XPS13, hit F12 several times as the Dell logo appeared, then changed the hard drive controller away from RAID.
I saved the BIOS settings and rebooted with my Xubuntu USB fob inserted.
I chose to boot the USB FOB and entered Xubuntu.
With RAID disabled, I could see the whole /dev/nvme0 device.
I attached a large SSD external drive and proceeded to back up the factory install partitions.

I grabbed the first 1MB which is too much data really since the bootsector is (I think) only the first 512 bytes.
But I have gotten into the habit of just grabbing a meg from the start of the disk:

cd /media/.../xps13-backups
dd if=/dev/nvme0n1 of=xps13.partitiontable.img bs=1MB count=1
for PART in 6 5 4 3 2 1 ; do
dd if=/dev/nvme0n1p${PART} bs=8M | bzip2 -9c > xps13.p${PART}.img
done


Now that I think I have a good factory copy of the data, I'm going to go ahead and boot microsoft to update (if needed) the BIOS, TPM firmware, and disable Content Adaptive Brightness Control.

I removed my live xubuntu stick and booted microsoft.
But oops, forgot to re-enable fake RAID.
Fixed and rebooted.

Walked through the various menus, created a local account with no password because this was temporary.
Next I installed Google Chrome. I then went to Dell's support and driver page, downloaded the automatic ID tool, and installed all of the detected drivers (which weren't that many) and BIOS updates.
Next I set about finding how to disable the Dynamic Brightness Control.
It was a little bit of a chore.
Several places said you had to contact tech support but with the right google-fu I thought I had it.
Only I missed that the file name had W81X64 not W10X64.
Eventually I figured out how to search on Dell's own site.
On the support page searched for "Firmware Update for enabling or disabling Dynamic Brightness Control" which gave me a couple of links.
The one I needed was:
http://www.dell.com/support/home/us/en/04/drivers/driversdetails?driverId=GKC0Y

I did all that on my other linux box because doing anything under microsoft is chore. I uploaded to my Gdrive from Linux and downloaded the exe to the laptop.
I ran the exe it unpacked and then I ran the resultant Application and chose to disable.
One more reboot to make sure the box comes back up.

Now time for giving this box purpose and usefulness.
I grabbed my Xubuntu USB fob and inserted on the right side USB slot and booted again, selecting F12 to get the one time boot menu.
For maximum safety, I wiped the first 10MB of the hard drive.
dd if=/dev/zero of=/dev/nvme0n1 bs=10M count=1

I rebooted, hit F12 again, and chose the USB FOB.

I chose Install Xubuntu and took most of the defaults. I did select use LVM and to encrypt my home directory, as well as selected the installation of 3rd party packages.

Once the installation was done, I rebooted.
I then logged in as my new user, and updated the system:
sudo apt-get -y update; sudo apt-get -y dist-upgrade; sudo apt-get -y autoremove; sudo apt-get -y autoclean

Since I have a running system that I'm copying data over from, I thought I'd open up SSH and log in remotely for the non-GUI configuration. So to enable SSHD:
sudo apt-get -y install openssh-server


Configuring the XPS13

Record encryption passphrase

Always need to remember to save this with a new box. I used to store the key in a GnuPG encrypted file, but now a Lastpass Note is more convenient.

Clickpad

First major snag for me. While I could get a middle button click or tap to work (see below for how), I could not figure out how to get a middle button click and drag to work. I spent several sessions with the new laptop trying to figure out the right combination of synaptics magic to make middle button click and drag to work to no avail. Middle button click and drag is really helpful in my regular development efforts in Rubymine and Goland by Intellij.

My clickpad was detected twice:
  1. DLL082A:01 06CB:76AF Touchpad
  2. SynPS/2 Synaptics Touchpad

The various searches I read on this topic said that disabling one of them would allow the middle button to work. In XFCE, I chose Mouse and Trackpad and chose the Synapics device, and disabled it.

http://en.community.dell.com/techcenter/os-applications/f/4613/t/19992924 suggests creating a static /etc/X11/xorg.conf.d file to set the SynPS/2 pad to ignore, but since the XFCE option worked, I'm inclined to just stick with that.

I don't have a solution yet for the middle button click and drag but I'm not going to spend any more time on it right now.

I adjusted some settings on the DLL082A:01 Touchpad, specifically ramped up the Acceleration because of the high resolution screen. I enabled “Disable touchpad while typing” though I can't really say I see the difference. Also I enabled horizontal scrolling.




Proprietary drivers

Under: Settings → Additional Drivers
  • enabled “Using Processor microcode firmware for Intel CPUs from intel-microcode)

Window Manager Settings

  1. Style: Greybird-accessibility
    1. Font size 11
    2. Add shade icon to title bar
  2. Keyboard
    1. “Resize Window”: Super+Down
    2. “Raise or lower window”: Ctrl+Tab
    3. “Fill Window horizontally”: Super+L
    4. “Fill Window vertically”: Super+H
    5. “Toggle Above”: CLEAR
    6. Tile window to top-left: Shift+Super+A
    7. Tile window to top-right: Shift+Super+S
    8. Tile window to bottom-left: Shift+Super+Z
    9. Tile window to bottom-right: Shift+Super+X
    10. Workspace 5: CLEAR
  3. Focus
    1. Radio: Focus Follows Mouse
    2. Slider: Minimum for Delay before window receives focus
    3. Deselect: Automatically give focus to newly created windows
  4. Advanced
    1. Select: To other windows
    2. Select: With a dragged window
    3. Change: Double click action to Maximize Window



Window Manager Tweaks

  1. Focus
    1. Select: Activate focus stealing prevention
    2. Change Radio: Switch to window's workspace
  2. Accessibility
    1. Change: Key used to grab and move windows: Super
    2. Select:
      1. Notify of urgency by making window's decoration blink
      2. Use mouse wheel on title bar to roll up the window
      3. Keep urgent windows blinking repeatedly
  3. Placement
    1. Slider: Minimum for Minimum size of windows to trigger smart placement
    2. Radio: Under the mouse pointer

Software

Non repository Software

  1. Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update 
sudo apt-get install google-chrome-stable

sudo rm /etc/apt/sources.list.d/google.list
  1. Perforce Helix Client
cd /usr/local
(umask 022; sudo tar zxvf /tmp/p4v.tgz)
export P4VER=p4v-2017.3.1590419
export ALT_VER=20171121
sudo cp /tmp/p4 /usr/local/${P4VER}/bin
sudo chmod 0755 /usr/local/${P4VER}/bin/p4
sudo chown -R bin:bin ${P4VER}
sudo mkdir -m 0755 -p /usr/share/icons/perforce
sudo update-alternatives --install /usr/local/bin/p4 p4 /usr/local/${P4VER}/bin/p4 ${ALT_VER}
sudo update-alternatives --install /usr/local/bin/p4v p4v /usr/local/${P4VER}/bin/p4v ${ALT_VER} \
 --slave /usr/share/icons/perforce/p4merge.svg p4merge.svg /usr/local/${P4VER}/lib/p4v/P4VResources/icons/p4merge.svg \
 --slave /usr/share/icons/perforce/p4v.svg p4v.svg /usr/local/${P4VER}/lib/p4v/P4VResources/icons/p4v.svg \
 --slave /usr/share/icons/perforce/p4admin.svg p4admin.svg /usr/local/${P4VER}/lib/p4v/P4VResources/icons/p4admin.svg
sudo update-alternatives --display p4v
sudo update-alternatives --display p4
  1. Jetbrains Rubymine
cd /usr/local
export RMVER=2017.2.4
export RM_ALT_VER=20171121
(umask 022; sudo tar zxvf /tmp/RubyMine-${RMVER}.tar.gz )
sudo chown -R bin:bin RubyMine-${RMVER}
sudo mkdir -p -m 0755 /usr/share/icons/rubymine
sudo update-alternatives --install  /usr/local/bin/rubymine.sh rubymine.sh /usr/local/RubyMine-${RMVER}/bin/rubymine.sh ${RM_ALT_VER} \
 --slave /usr/share/icons/rubymine/rubymine.png  rubymine.png  /usr/local/RubyMine-${RMVER}/bin/rubymine.png \
 --slave /usr/share/icons/rubymine/RMlogo.svg    RMlogo.svg    /usr/local/RubyMine-${RMVER}/bin/Rmlogo.svg
sudo update-alternatives --display rubymine.sh
  1. Jetbrains Goland
cd /usr/local
export GOLANDVER=173.3727.73
export GOLANDALTVER=20171121
(umask 022; sudo tar zxvf /tmp/goland-${GOLANDVER}.tar.gz )
sudo chown -R bin:bin GoLand-${GOLANDVER}
sudo mkdir -p -m 0755 /usr/share/icons/goland
sudo chown root:root /usr/share/icons/goland
sudo update-alternatives --install  /usr/local/bin/goland.sh goland.sh /usr/local/GoLand-${GOLANDVER}/bin/goland.sh ${GOLANDALTVER} \
 --slave /usr/share/icons/goland/goland.png  goland.png  /usr/local/GoLand-${GOLANDVER}/bin/goland.png

sudo update-alternatives --display goland.sh



  1. Jetbrains PyCharm (community)
cd /usr/local
export PYVER=2017.2.4
export PYALTVER=20171121
(umask 022; sudo tar zxvf /tmp/pycharm-community-${PYVER}.tar.gz )
sudo chown -R bin:bin pycharm-community-${PYVER}
sudo mkdir -p -m 0755 /usr/share/icons/pycharm
sudo update-alternatives --install  /usr/local/bin/pycharm.sh pycharm.sh /usr/local/pycharm-community-${PYVER}/bin/pycharm.sh ${PYALTVER} \
 --slave /usr/share/icons/pycharm/pycharm.png  pycharm.png  /usr/local/pycharm-community-${PYVER}/bin/pycharm.png
sudo update-alternatives --display pycharm.sh
  1. Codeweaver's Crossover
sudo dpkg -i /tmp/crossover_16.2.5-1.deb

sudo apt-get -f install
  1. Slack chat client
sudo dpkg -i /tmp/slack-desktop-2.9.0-amd64.deb
sudo bash /etc/cron.daily/slack
sudo chmod 0644 /etc/apt/sources.list.d/slack.list
  1. Oracle Java
  • http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
    and
    http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
    download and put tarball & zip in /tmp
    export JAVA_MINOR=152
    export JAVA_ALT_VER=20171121
    cd /usr/lib/jvm
    (umask 022; sudo tar zxvf /tmp/jdk-8u${JAVA_MINOR}-linux-x64.tar.gz)
    sudo gzip -9v jdk1.8.0_${JAVA_MINOR}/man/man1/*
    sudo chown -R bin:bin jdk1.8.0_${JAVA_MINOR}
    #
    export LINKDIR=/usr/bin
    export MANLINK=/usr/share/man/man1
    export JRELINK=/usr/lib/jvm/jdk1.8.0_${JAVA_MINOR}
    export JHOME=${JRELINK}
    export JREDIR=${JHOME}/jre/bin
    export JDKDIR=${JHOME}/bin
    export MANDIR=${JHOME}/man/man1
    bash -s <<'EOF'
    sudo update-alternatives --install ${LINKDIR}/java java ${JREDIR}/java ${JAVA_ALT_VER} \
    --slave ${LINKDIR}/jcontrol jcontrol ${JREDIR}/jcontrol \
    --slave $MANLINK/java.1.gz java.1.gz ${MANDIR}/java.1.gz
    sudo update-alternatives --install ${LINKDIR}/jjs jjs ${JREDIR}/jjs ${JAVA_ALT_VER} \
    --slave $MANLINK/jjs.1.gz jjs.1.gz ${MANDIR}/jjs.1.gz
    sudo update-alternatives --install ${LINKDIR}/policytool policytool ${JREDIR}/policytool ${JAVA_ALT_VER}
    sudo update-alternatives --install ${LINKDIR}/servertool servertool ${JREDIR}/servertool ${JAVA_ALT_VER} \
    --slave $MANLINK/servertool.1.gz servertool.1.gz ${MANDIR}/servertool.1.gz
    sudo update-alternatives --install ${LINKDIR}/keytool keytool ${JREDIR}/keytool ${JAVA_ALT_VER} \
    --slave $MANLINK/keytool.1.gz keytool.1.gz ${MANDIR}/keytool.1.gz
    sudo update-alternatives --install ${LINKDIR}/orbd orbd ${JREDIR}/orbd ${JAVA_ALT_VER} \
    --slave $MANLINK/orbd.1.gz orbd.1.gz ${MANDIR}/orbd.1.gz
    sudo update-alternatives --install ${LINKDIR}/pack200 pack200 ${JREDIR}/pack200 ${JAVA_ALT_VER} \
    --slave $MANLINK/pack200.1.gz pack200.1.gz ${MANDIR}/pack200.1.gz
    sudo update-alternatives --install ${LINKDIR}/rmid rmid ${JREDIR}/rmid ${JAVA_ALT_VER} \
    --slave $MANLINK/rmid.1.gz rmid.1.gz ${MANDIR}/rmid.1.gz
    sudo update-alternatives --install ${LINKDIR}/rmiregistry rmiregistry ${JREDIR}/rmiregistry ${JAVA_ALT_VER} \
    --slave $MANLINK/rmiregistry.1.gz rmiregistry.1.gz ${MANDIR}/rmiregistry.1.gz
    sudo update-alternatives --install ${LINKDIR}/tnameserv tnameserv ${JREDIR}/tnameserv ${JAVA_ALT_VER} \
    --slave $MANLINK/tnameserv.1.gz tnameserv.1.gz ${MANDIR}/tnameserv.1.gz
    sudo update-alternatives --install ${LINKDIR}/unpack200 unpack200 ${JREDIR}/unpack200 ${JAVA_ALT_VER} \
    --slave $MANLINK/unpack200.1.gz unpack200.1.gz ${MANDIR}/unpack200.1.gz
    sudo update-alternatives --install ${LINKDIR}/javaws javaws ${JREDIR}/javaws ${JAVA_ALT_VER}
    EOF
    #
    cd /usr/lib/jvm/jdk1.8.0_${JAVA_MINOR}/jre/lib/security
    sudo unzip -j /tmp/jce_policy-8.zip
    sudo chown -R bin:bin /usr/lib/jvm/jdk1.8.0_${JAVA_MINOR}

Additional Software

  1. Misc Ubuntu Repo Software
  • sudo apt-get install xscreensaver xscreensaver-data-extra xscreensaver-gl vim nedit fonts-inconsolata fonts-ubuntu-font-family-console fonts-ubuntu-title ttf-ubuntu-font-family ttf-xfree86-nonfree xfonts-base curl rxvt-unicode-256color rxvt screen ctags xdaliclock fortune-mod fortunes-ubuntu-server fortunes-off fortunes-min xfonts-100dpi xscreensaver-data openconnect network-manager-openconnect{,-gnome} openjdk-8-jdk libbonobo2-bin libgnomevfs2-bin libgnomevfs2-extra gnome-mime-data libice-doc libsm-doc libxcb-doc libxt-doc openjdk-8-demo ruby awscli xfce4-artwork xfce4-battery-plugin xfce4-cpufreq-plugin xfce4-datetime-plugin xfce4-diskperf-plugin xfce4-goodies xfce4-sensors-plugin seahorse rdesktop xfsprogs btrfs-tools openssh-server dump ttf-bitstream-vera ri ruby-dev bundler xsensors attr quota cifs-utils xfonts-terminus xfonts-terminus-oblique ntp devilspie2 dos2unix terminator slack
    sudo fc-cache -f -v
    sudo apt-get install vinagre iperf
  1. RVM
  • gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
    \curl -sSL https://get.rvm.io | bash -s stable –ruby
  1. Docker
sudo apt-get install docker docker.io
sudoedit /lib/systemd/system/docker.service
## add –dns <YOUR DNS SERVER HERE> before -H
sudo systemctl daemon-reload
sudo systemctl restart docker.service
cd /tmp
curl -sL https://github.com/docker/compose/releases/download/1.17.0/docker-compose-`uname -s`-`uname -m` > /tmp/docker-compose
sudo mv /tmp/docker-compose /usr/local/bin
sudo chown bin:bin /usr/local/bin/docker-compose
sudo chmod 0755 /usr/local/bin/docker-compose

sudoedit /etc/group
## add user to docker group
  1. Steam
sudo dpkg --add-architecture i386
sudo apt-get update && sudo apt-get install steam





More Configuration

Applications

  1. xfce panels
    1. Exported panel from desktop
      copied to xps 13
      Opened XFCE Panel Switch
      Imported tarball
  2. devilspie2
    1. Goto Settings → Session and Startup
      1. Create a new Application Autostart
        1. Devilspie2
          Devilspie2
          /usr/bin/devilspie2
    2. vim .config/devilspie2/web.lua
Devices
  1. Keyboard
    1. Application Shortcuts
  • Add new: “/home/myuser/bin/run-urxvt”: Super+T (replaces exo-open –launch TerminalEmulator)
  • Change “xflock4: Ctrl+Alt+L” to Super+L
  1. Clickpad
    1. update /usr/share/X11/xorg.conf.d/70-synaptics.conf
# Example xorg.conf.d snippet that assigns the touchpad driver
# to all touchpads. See xorg.conf.d(5) for more information on
# InputClass.
# DO NOT EDIT THIS FILE, your distribution will likely overwrite
# it when updating. Copy (and rename) this file into
# /etc/X11/xorg.conf.d first.
# Additional options may be added in the form of
#   Option "OptionName" "value"
#
Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
# This option is recommend on all Linux systems using evdev, but cannot be
# enabled by default. See the following link for details:
# http://who-t.blogspot.com/2010/11/how-to-ignore-configuration-errors.html
      MatchDevicePath "/dev/input/event*"
EndSection

Section "InputClass"
        Identifier "touchpad ignore duplicates"
        MatchIsTouchpad "on"
        MatchOS "Linux"
        MatchDevicePath "/dev/input/mouse*"
        Option "Ignore" "on"
EndSection

# This option enables the bottom right corner to be a right button on clickpads
# and the right and middle top areas to be right / middle buttons on clickpads
# with a top button area.
# This option is only interpreted by clickpads.
Section "InputClass"
        Identifier "Default clickpad buttons"
        MatchDriver "synaptics"
        #Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
        Option "SoftButtonAreas" "66% 0 82% 0 33% 66% 82% 0"
        Option "SecondarySoftButtonAreas" "58% 0 0 15% 42% 58% 0 15%"
EndSection

# This option disables software buttons on Apple touchpads.
# This option is only interpreted by clickpads.
Section "InputClass"
        Identifier "Disable clickpad buttons on Apple touchpads"
        MatchProduct "Apple|bcm5974"
        MatchDriver "synaptics"
        Option "SoftButtonAreas" "0 0 0 0 0 0 0 0"
EndSection
VPN



<needs formatting>
sudo apt-get install pulseaudio-module-bluetooth
sudoedit /etc/pulse/default.pa
## add load-module module-switch-on-connect
## after load-module module-switch-on-port-available
sudo init 6  (maybe restarting pulseaudio)

Post Installation Updates

golang 1.9
export GOVER=1.9
export GOMINOR=2
cd /tmp
wget https://storage.googleapis.com/golang/go${GOVER}.${GOMINOR}.linux-amd64.tar.gz
(umask 022; tar zxf go${GOVER}.${GOMINOR}.linux-amd64.tar.gz)
mv go go${GOVER}
sudo mv go${GOVER} /usr/local
sudo chown -R bin:bin /usr/local/go${GOVER}
vim ~/.bashrc
export GOROOT=/usr/local/go1.9.2
export PATH=${PATH}:${GOROOT}/bin



jetbrains goland
cd /usr/local
export GOLANDVER=2017.3
export GOLANDALTVER=20171204
(umask 022; sudo tar zxvf /tmp/goland-${GOLANDVER}.tar.gz )
sudo chown -R bin:bin GoLand-${GOLANDVER}
sudo mkdir -p -m 0755 /usr/share/icons/goland
sudo chown root:root /usr/share/icons/goland

sudo update-alternatives --install /usr/local/bin/goland.sh goland.sh /usr/local/GoLand-${GOLANDVER}/bin/goland.sh ${GOLANDALTVER} \
--slave /usr/share/icons/goland/goland.png goland.png /usr/local/GoLand-${GOLANDVER}/bin/goland.png

sudo update-alternatives --display goland.sh









Comments

Popular posts from this blog

Xubuntu Home Server on Dell XPS 13 9370

Cygwin + syslog-ng

Fedora - VNC through systemd/xinetd