L4T Ubuntu - A fully featured linux on your switch

switchroot.png

L4T Ubuntu 3.4.0
Intro
L4T Ubuntu is a version of Linux based on nvidia's linux for tegra project. It uses a different kernel compared to previous releases which allows it to use features not yet in mainline. Such as audio, docking support and vulkan.

Beware, using high clocks in handheld mode will degrade your batteries capacity a lot faster than at stock clocks

If you can't install an application check this thread, and ask all questions there
https://gbatemp.net/threads/l4t-ubuntu-applcation-install-guides.537579/

https://discord.gg/N9PPYXjWMY

We have a wiki !
To facilitate our work we will only update our wiki from now on in order to avoid multiple outdated references, please refer to the following link instead of this page

https://wiki.switchroot.org/en/Linux/Ubuntu-Install-Guide

3.4.0 update file listed below With the 3.0+ updates. If doing fresh install, install 3.4.0 image.


Big Thanks to CTCaer for 3.4.0, for fixing the final issues in Ubuntu/Linux kernel and all the testers that helped him.

Features

  • Full USB PD/OTG/OTG Docks
  • Bluetooth (both controllers and audio)
  • Full Joycon Support(Excluding NFC, and IRcamera)
  • Nvidia GPU drivers - Vulkan and OpenGL
  • Audio - Headphones, speakers and over HDMI when docked.
  • Touchscreen(more fixes)
  • Display
  • WiFi(sleep fixes/stability fixes)
  • CPU frequency scaling - The CPU scales from 200mhz to 1.7ghz (what switch is binned for) depending on the load its under. Fans are adjusted to account for this
  • Full sdcard speed
  • Hardware video acceleration when using the built in videos app (means you can watch videos without battery draining massively)
  • Overclocking
  • LP0 Sleep mode
  • IMU/Ambiant Light sensor support
  • reboot2payload
  • Minerva Memory Training
  • Support for Moonlight-QT
  • Initramfs updates(fix partition resize, add boot logo, and error screens)
Prerequisites
  • Minimum of 8 GB.
Downloads
Torrent Links can be found here:
https://torrents.switchroot.org/ubuntu/

Updates for previous 3.0+ installs. 3.4.0 link below.

https://download.switchroot.org/ubuntu/switchroot-ubuntu-3.4.0-update_only-2021-07-23.7z
1. Remove l4t-ubuntu folder and bootloader\ini\01-ubuntu.ini from fat32 partition on sdcard.
2. Extract zip to fat32 partition on sdcard.(if you have no space, try removing all ubuntu related files from fat32 partition on sdcard, and try again.)
3. Dump joycon pairing info in hekate.(Only needs to be done if you havnt already done this)
4. Boot.

How to install:
  1. Download the image (standard non cuda is probably what you want) you want from the downloads section.
  2. Partition with hekate, make sure to leave enough room on fat32 to extract chosen image.
  3. Extract 7z to fat32 partition, now labeled SWITCHSD
  4. Flash image in partition manager in hekate to linux partition.
  5. Go to NYX tools, and dump joycon pairing data, with joycons connected to console, after being paired in hos.
  6. Launch ubuntu through hekate.
  7. Wait for around 2-4 minutes while it initially loads.
  8. Enjoy, you now have fully featured Ubuntu on your switch!
Notes:
  • Pair procons by opening the bluetooth menu in settings and pressing the + button in the bottom left corner. Then press the sync button on the controller and select its name in the pairing window.
  • To update the system run "sudo apt update", "sudo apt upgrade". This will apply all switch and ubuntu updates aside from kernel updates, they will be posted here if ever needed.
  • CPU/GPU/Fan profiles and Overclocking are now handles in NVPmodel.
  • Disabled sandboxing in Chromium in order to enable GPU acceleration
    Night and day difference. Existing users can add --no-sandbox to their desktop shortcut.
Ubuntu Bionic 3.4.0 Short Changelog:
- Better performances in many scenarios (As always that should affect apps/games/emus/etc)
- Significant better deep sleep. (Measured at 582 hours. 440% better).
- Faster wake up from sleep.
- Saved 240MB ram (fb and active file page pool, aka always used pool)
- Memory remapping 800%-2000% speed up. Mostly used by emulators and VMs (and lot in android).
- Some other memory optimizations, plus enabled huge ram pages
- Faster kernel and OS boot.
- Fixed tearing issues for NVDEC/NVENC. (video hw accel)
- Lower latency for frame end calcs for builtin display
- Fixed Hori pads for joycond
- Fixed an issue where it would make railed jc to disconnect on rumble
- Joycon/Procon rumble was improved and intensity tuned for better user experience
- Kernel now uses the proper display panel init/deinit by checking panel id
- Improved dock/undock script
- Touch stays enabled now in dock mode. Users that use docks that do not cover the screen can use it as alternative input.
- Added low ram protection. Now instead of hanging for minutes it will only stutter for seconds until oom occurs and recovers ram
- Better seamless display on boot
- uenv.txt changed, read uenv_readme.txt. It's simple to transfer over custom settings.
- Reboot action can now be defined in new uenv.txt. Reboot back into Linux by changing `reboot_action=` from `bootloader` to `via-payload`.

Apps Changes:
- Full video HW decoding via new SMPV Player app (also supports youtube links)
- Full video HW encoding via ffmpeg-l4t
- Added L4T-Megascript app
You can get or build various essential stuff, apps or emulators with a single click. All configured and optimized for Switch.
- Nvpmodel was updated to include Battery charging protection limits options
Useful when you are constantly docked and want to protect battery's life.
Limit gets saved and applied on boot.
Reminder that discharging can't happen when plugged in. Even when charging is off, usb power is used to supplement system.
So you need to discharge first if you want the battery % to go inside the limit.
That also disables charging in sleep in order for the feature to work.
If you reboot/shutdown, it gets disabled and re-enabled at the next L4T boot.
As always the source is public and all L4T based projects for Switch will benefit (L4T linux distros/Lakka/Android)



Sources
They can all be found at https://gitlab.com/switchroot with the other kernel repos on http://nv-tegra.nvidia.com

Use these scripts if you want to build your own kernel: https://gitlab.com/switchroot/kernel/l4t-kernel-build-scripts/tree/test


Credits
Bylaws,
Langerhans,
Ave,
Natinusala,
CTCaer(most of the hard stuff),
Gavin_Darkglider,
DanielOgorchock(Joycon drivers/joycond),
stary2001 (reboot2payload),
NVIDIA,
Azkali
Everyone else in switchroot - more info on that in the future.
 
Last edited by azkali,

tabzer

etymological and/or pedantic
Member
Joined
Feb 15, 2019
Messages
3,487
Trophies
1
Age
38
XP
2,667
Country
Japan
I can't seem to get this to work after a few re-tries, i'll try and mention all the steps i did, hopefully someone will see what i did wrong.


After the switch turned off the first time, did you try booting with the payload again?
 

theory18

Active Member
Newcomer
Joined
Mar 2, 2010
Messages
33
Trophies
0
XP
35
Country
United States
After the switch turned off the first time, did you try booting with the payload again?
I did not, i followed a tutorial and a youtube video and both just launched into linux after the 2-4 minute wait, so i wait 10min and thought it didn't work.
 

tabzer

etymological and/or pedantic
Member
Joined
Feb 15, 2019
Messages
3,487
Trophies
1
Age
38
XP
2,667
Country
Japan
The first time I followed the tutorial, it worked fine the first time.

The second time I did the process I had to try turning my switch on multiple times. I don't know if it was the update or a fluke. But after it finially initialized, I no longer have boot issues.
 

GibboHull

Active Member
Newcomer
Joined
Apr 4, 2019
Messages
25
Trophies
0
Age
29
XP
156
Country
United Kingdom
He was talking about the 1.1 update, which does not need to be burned to the sd card. Only needs to be copied and pasted.

I know.

But he was saying that he could not find the first partition. Which, like i said, comes up as a normal folder structure when the SD card is inserted. I added the burn bit in just in case he didn't do it. No point him searching for it if he just copied the img to a memory stick.
 

A3660537JPN

Well-Known Member
Member
Joined
Sep 13, 2017
Messages
117
Trophies
0
Age
32
XP
1,134
Country
Japan
I did not, i followed a tutorial and a youtube video and both just launched into linux after the 2-4 minute wait, so i wait 10min and thought it didn't work.
The time it takes is different by microSD.
Some microSDs it takes 1 minutes,others it takes 1 hour.
 

gutop

Member
Newcomer
Joined
Mar 14, 2010
Messages
12
Trophies
0
XP
65
Country
Luxembourg
Hi, i have a question. How can i set up the Joycon controllers in the Dolphin Emulator?
I paired it with the Bluetooth, but there's no reaction in the Dolphin Controller Settings. Thanks
 

MartianMSK

Well-Known Member
Newcomer
Joined
Jun 17, 2018
Messages
55
Trophies
0
Age
25
XP
1,389
Country
Italy
Hi, i have a question. How can i set up the Joycon controllers in the Dolphin Emulator?
I paired it with the Bluetooth, but there's no reaction in the Dolphin Controller Settings. Thanks
Did you press L and R togheter after having paired them both?
You have one green light on both or four, flashing?
 

PokOeLe

Member
Newcomer
Joined
May 1, 2019
Messages
14
Trophies
0
Age
22
XP
79
Country
Afghanistan
its a good idea, but i've tried LOTS of workarounds with no success

I just went to a shop and bought a 12 Euro 16GB SanDisk SD card, flashed the image with Balena Etcher on MacOSX, drop the card inside the switch, booted Hekate, and Boom! after less than one minute the Installer showed up! So indeed it was my SD card. I don't understand why, I tried two samsung Evo plus SD cards one 128GB and the other 64GB and both of them didn't work!

Hope this solves your problem too. Buy a cheap card just for for Linux
 

bylaws

Well-Known Member
OP
Member
Joined
Dec 11, 2018
Messages
129
Trophies
0
XP
1,140
Country
United Kingdom
Don't have my switch at hand and would like to do some testing on a virtual machine. Does anyone know if and how to get the image working in VirtualBox?
Already tried converting the .img File to .vdi with VirtualBox's integrated tools but the VB didn't recognise the drive as bootable.

Edit: nvmd, forgot that VirtualBox only runs x86, will try with qemu
You can setup binfmt with qemu user-static and chroot in but you won't get any graphics
I just went to a shop and bought a 12 Euro 16GB SanDisk SD card, flashed the image with Balena Etcher on MacOSX, drop the card inside the switch, booted Hekate, and Boom! after less than one minute the Installer showed up! So indeed it was my SD card. I don't understand why, I tried two samsung Evo plus SD cards one 128GB and the other 64GB and both of them didn't work!

Hope this solves your problem too. Buy a cheap card just for for Linux
Yeah, I'm still working out what causes sdcard bugs
 

Prankst3r

Member
Newcomer
Joined
Apr 14, 2019
Messages
10
Trophies
0
Age
121
XP
199
Country
Germany
I just went to a shop and bought a 12 Euro 16GB SanDisk SD card, flashed the image with Balena Etcher on MacOSX, drop the card inside the switch, booted Hekate, and Boom! after less than one minute the Installer showed up! So indeed it was my SD card. I don't understand why, I tried two samsung Evo plus SD cards one 128GB and the other 64GB and both of them didn't work!

Hope this solves your problem too. Buy a cheap card just for for Linux

Have you tried Scandisk? If you have windows, start CMD and type "chkdsk x: /x /r /f"; x: is the letter of your sd card. There should be something similar for MacOSX.

edit: for MacOSX: "diskutil verifyVolume [drive identifier]" and "diskutil repairvolume [drive identifier]"
 
Last edited by Prankst3r,

swabbo

Wot u doin readin dis m8?
Member
Joined
Mar 9, 2011
Messages
806
Trophies
0
Age
27
Location
East Yorkshire/ A Bin
XP
2,157
Country
OK, so after messing around with Qjoypad I figured it was highly outdated and looked for something else.
Turns out the simplest way to control mouse with joycon is to do:
sudo apt install xserver-xorg-input-joystick
and reboot!
Voila!

p.s 'A' is left click and 'X' is left click. I am pretty sure the sensitivity can be altered through mouse settings.

Thanks for the alternative dude but I tried this, a is middle mouse click, y is right click and b is left click and my left analog stick’s up/down are reversed, no idea how to change it
 

P3T3

Well-Known Member
Member
Joined
Oct 15, 2018
Messages
130
Trophies
0
Age
39
XP
268
Country
United Kingdom
I couldn't figure a way around this. I figured out how to exit Kodi, but logging in again booted it back up. Can't use the keyboard or mouse either. It's a trap! I ended up reimaging.

What guide did you use to compile kodi on unbuntu?
 
General chit-chat
Help Users
    NeoGaming @ NeoGaming: yo kennies shut the hell up bitch