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,

Cation163

Member
Newcomer
Joined
Oct 24, 2019
Messages
5
Trophies
0
Age
42
XP
47
Country
Russia
Good afternoon.

Love the idea of using my Switch as a portable PC when I travel.
Anyone heard anything about Nintendo ban when using installation guide from this topic?
I mean I do not have intention to play illegal games, L4T/official gaming only. But cannot find any feedback whether big N bans for any loader exploits or unofficial gaming only?

Thanks in advance.

PS. Can't find how to delete clone messages.
 
Last edited by Cation163,

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
Great news. I wasn't aware that a Joy Con rail driver was being worked on. Will the updated image include reboot to payload as well? Either way, I can't wait for it. Thanks for all your hard work.
I pushed reboot2payload for ubuntu a month or so before android. go check page 98, you want the 1.5.0 update. ;)
Oh sweet! I'm all for a new image myself if it means a better overall experience.
Not really. The image will be the same, just a few config file edits, a copy of hekate for a reboot payload, and joycond, for the hid-nintendo and new joycon rail driver. Really, for what you are looking for, I am sure that our gentoo and arch builds are probably more your speed. ;) Much more updated packages. For some reason 18.04 is still outdated, and poorly optimized for the switch. It works, but ubuntu, and most distros compile packages to be as generic as possible for an arch(so it will run on all arm64 chips, but isnt optimized to the tegra 210 in the switch.) Gentoo lets you get around this problem, because you compile it from the ground up. Arch is a happy medium, because of AUR. Now, both of these builds is still in development, so they are missing some things(OpenMAX, Cuda, CUDNN, etc.) Mainly deb packages installed on top of ubuntu, I havnt converted yet.
 
Last edited by Gavin_Darkglider,

CalcProgrammer1

Member
Newcomer
Joined
May 4, 2019
Messages
19
Trophies
0
Age
33
XP
137
Country
United States
Looking forward to Joycon rails driver! Being able to used joycons with external power and no Bluetooth would be great, I'd definitely like to use Joycons as a mouse, maybe with a button set to toggle soft keyboard.
 
D

Deleted User

Guest
Good afternoon.

Love the idea of using my Switch as a portable PC when I travel.
Anyone heard anything about Nintendo ban when using installation guide from this topic?
I mean I do not have intention to play illegal games, L4T/official gaming only. But cannot find any feedback whether big N bans for any loader exploits or unofficial gaming only?

Thanks in advance.

PS. Can't find how to delete clone messages.
They literally cannot ban you as Horizon OS never starts.
 

biip

New Member
Newbie
Joined
Nov 6, 2019
Messages
2
Trophies
0
Age
40
XP
47
Country
Syria
i.ibb.co/3yhygV5/IMG-20191105-142924.jpg
i.ibb.co/zG0BK8J/IMG-20191105-142537.jpg

that's my ubuntu set up right now! foldable bluetooth keyboard that fits inside the bag like a glove. it has it's own stand and for charging i just do "xrandr -o inverted" to invert the screen.
which code editors you recommend for the L4T? Usually I use sublime text 3, but wasn't able to install it since it doesn't have an ARM build. if someone was successful with ST3 or similar please share the secret.
 
Last edited by biip,
  • Like
Reactions: stick267

CalcProgrammer1

Member
Newcomer
Joined
May 4, 2019
Messages
19
Trophies
0
Age
33
XP
137
Country
United States
which code editors you recommend for the L4T? Usually I use sublime text 3, but wasn't able to install it since it doesn't have an ARM build. if someone was successful with ST3 or similar please share the secret.

I use Headmelted's arm64 VS Code builds. Some of the capability is reduced vs. the x86/amd64 version due to various addons not working (C/C++ intellisense doesn't work) but the editor and syntax highlighting works great.
 

biip

New Member
Newbie
Joined
Nov 6, 2019
Messages
2
Trophies
0
Age
40
XP
47
Country
Syria
I use Headmelted's arm64 VS Code builds. Some of the capability is reduced vs. the x86/amd64 version due to various addons not working (C/C++ intellisense doesn't work) but the editor and syntax highlighting works great.
i've tried today.. felt super slow and buggy. one time even froze on me for more than 5 minutes.
i might just keep using gedit with some custom plugins if i can't find a better option. :unsure:

edit: i also tried to install hangover like you suggested in other post. couldn't get it to compile without errors, even after 10x make -j4
 
Last edited by biip,

CalcProgrammer1

Member
Newcomer
Joined
May 4, 2019
Messages
19
Trophies
0
Age
33
XP
137
Country
United States
I get random hangups with everything sometimes. Terminal, Firefox, Chrome, Code, etc. It seems like the kernel is waiting on some blocking operation and preventing anything else. I'm using a Samsung Evo Select 256GB card.
 

Halo69

Well-Known Member
Newcomer
Joined
Aug 6, 2019
Messages
58
Trophies
0
Age
45
XP
108
Country
United States
As promised..... I give you Reboot2Payload update for l4t-ubuntu. This update comes with a little more hassle than the previous updates, but it is worth it.

1. Download and extract this to boot(fat32) partition, should overwrite all ubuntu files there: https://www.dropbox.com/s/6mchw2491c1ek36/l4t-ubuntu-reboot2payload.zip?dl=0

2. boot console.
3. Do everything after this as root
3A. If you are overclocking on boot using /etc/rc.local:
change script to
Code:
#!/bin/bash
echo 1 > /sys/kernel/tegra_cpufreq/overclock
echo  2091000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload
exit 0
3B. If not overclocking:
1. Create /etc/rc.local eg. touch /etc/rc.local
2. make rc.local executable eg. chmod +x /etc/rc.local
3. edit /etc/rc.local to add
Code:
#!/bin/bash
echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload
exit 0
4. copy payload of your choice to /lib/firmware and rename it to reboot_payload.fw

5. if doing this on l4t-ubuntu, run in your root terminal: echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload

6. Now reboot to your payload. There is a custom_payload option, that you can echo the name of another payload also in /lib/firmware into and it will reboot to that payload as well.

Credit goes to:
@Stary#0632 for porting reboot2payload from Atmosphere into Coreboot/ATF/U-boot/Kernel :)
@Gavin_Darkglider for testing, and building update for you guys, and writing this awesome guide.
@Switchroot for the awesome work they are doing in the scene, for both linux and android development

Should also thank the atmosphere developers for creating what was ported as well. ;)
Are those codes to run it in terminal?
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
33
XP
571
Country
United States
No, those are put in rc.local. But that being said, I am doing a bunch of updates to ubuntu, and that wont be needed in the future.

We managed to get stable lp0 in ubuntu, and I am adding a bunch of the fixes from the new kernel. New joycon drivers, new touchscreen. Basically I am working on 2 things, 1 a new base image, and 2 updating the ubuntu repo, so you can get all of the userspace changes through apt update.
 
Last edited by Gavin_Darkglider,

Halo69

Well-Known Member
Newcomer
Joined
Aug 6, 2019
Messages
58
Trophies
0
Age
45
XP
108
Country
United States
No, those are put in rc.local. But that being said, I am doing a bunch of updates to ubuntu, and that wont be needed in the future.

We managed to get stable lp0 in ubuntu, and I am adding a bunch of the fixes from the new kernel. New joycon drivers, new touchscreen. Basically I am working on 2 things, 1 a new base image, and 2 updating the ubuntu repo, so you can get all of the userspace changes through apt update.
Ok cool, i am starting to learn linux as much as possible but where will i find rc.local?
As promised..... I give you Reboot2Payload update for l4t-ubuntu. This update comes with a little more hassle than the previous updates, but it is worth it.

1. Download and extract this to boot(fat32) partition, should overwrite all ubuntu files there: https://www.dropbox.com/s/6mchw2491c1ek36/l4t-ubuntu-reboot2payload.zip?dl=0

2. boot console.
3. Do everything after this as root
3A. If you are overclocking on boot using /etc/rc.local:
change script to
Code:
#!/bin/bash
echo 1 > /sys/kernel/tegra_cpufreq/overclock
echo  2091000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload
exit 0
3B. If not overclocking:
1. Create /etc/rc.local eg. touch /etc/rc.local
2. make rc.local executable eg. chmod +x /etc/rc.local
3. edit /etc/rc.local to add
Code:
#!/bin/bash
echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload
exit 0
4. copy payload of your choice to /lib/firmware and rename it to reboot_payload.fw

5. if doing this on l4t-ubuntu, run in your root terminal: echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload

6. Now reboot to your payload. There is a custom_payload option, that you can echo the name of another payload also in /lib/firmware into and it will reboot to that payload as well.

Credit goes to:
@Stary#0632 for porting reboot2payload from Atmosphere into Coreboot/ATF/U-boot/Kernel :)
@Gavin_Darkglider for testing, and building update for you guys, and writing this awesome guide.
@Switchroot for the awesome work they are doing in the scene, for both linux and android development

Should also thank the atmosphere developers for creating what was ported as well. ;)
I am not to familiar with linux and trying to learn it. I'm using L4T ubuntu and can you show me how and where to create /etc/rc.local eg. touch /etc/rc.local
Then make that executable.
Do i have to create it just like that? What does the (eg) stand for? Not sure if thats part of it
 

Halo69

Well-Known Member
Newcomer
Joined
Aug 6, 2019
Messages
58
Trophies
0
Age
45
XP
108
Country
United States
As promised..... I give you Reboot2Payload update for l4t-ubuntu. This update comes with a little more hassle than the previous updates, but it is worth it.

1. Download and extract this to boot(fat32) partition, should overwrite all ubuntu files there: https://www.dropbox.com/s/6mchw2491c1ek36/l4t-ubuntu-reboot2payload.zip?dl=0

2. boot console.
3. Do everything after this as root
3A. If you are overclocking on boot using /etc/rc.local:
change script to
Code:
#!/bin/bash
echo 1 > /sys/kernel/tegra_cpufreq/overclock
echo  2091000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload
exit 0
3B. If not overclocking:
1. Create /etc/rc.local eg. touch /etc/rc.local
2. make rc.local executable eg. chmod +x /etc/rc.local
3. edit /etc/rc.local to add
Code:
#!/bin/bash
echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload
exit 0
4. copy payload of your choice to /lib/firmware and rename it to reboot_payload.fw

5. if doing this on l4t-ubuntu, run in your root terminal: echo 1 > /sys/bus/platform/drivers/tegra-reboot2payload/r2p/default_payload

6. Now reboot to your payload. There is a custom_payload option, that you can echo the name of another payload also in /lib/firmware into and it will reboot to that payload as well.

Credit goes to:
@Stary#0632 for porting reboot2payload from Atmosphere into Coreboot/ATF/U-boot/Kernel :)
@Gavin_Darkglider for testing, and building update for you guys, and writing this awesome guide.
@Switchroot for the awesome work they are doing in the scene, for both linux and android development

Should also thank the atmosphere developers for creating what was ported as well. ;)
To create /etc/rc.local on the switch do i have to enter: sudo nano /etc/rc.local
 

Halo69

Well-Known Member
Newcomer
Joined
Aug 6, 2019
Messages
58
Trophies
0
Age
45
XP
108
Country
United States
Also how do i boot to ofw? Or do i have to add a payload for it?

--------------------- MERGED ---------------------------

I used to have Noob-friendly L4T ubuntu installed and decided to install this image, i installed twice and my joycons are connected to bluetooth but they not working, i press L3 for mouse but nothing.
 

Worldblender

Well-Known Member
Member
Joined
May 27, 2019
Messages
307
Trophies
0
Age
26
XP
1,868
Country
United States
But do i have to install nano 1st? I see that gedit is installed
You don't actually have to install nano first. You could also use gedit (or vim if you're brave enough) and save this file in the same place. Run this like:
Code:
sudo gedit /etc/rc.local

Also how do i boot to ofw? Or do i have to add a payload for it?

I used to have Noob-friendly L4T ubuntu installed and decided to install this image, i installed twice and my joycons are connected to bluetooth but they not working, i press L3 for mouse but nothing.

If nothing else is installed on the microSD card on which your L4T Ubuntu installation resides on, your only option is to disable autoRCM (beware that this goes through the fuse check; if you're running on older OFW version and there are more fuses burnt than expected, your system won't boot). If you have Atmosphere or Kosmos Atmosphere installed, you can use their provided configs to boot into OFW, only this time it can bypass the fuse check.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Skelletonike @ Skelletonike:
    3h left until work finishes, bah
  • Skelletonike @ Skelletonike:
    link doesn't work
    +2
  • Skelletonike @ Skelletonike:
    1H left, such a slow week.
  • Sonic Angel Knight @ Sonic Angel Knight:
    Okay, I had spaghetti :P
  • SylverReZ @ SylverReZ:
    Hope they made lots of spaget
  • K3N1 @ K3N1:
    Chill dog
  • SylverReZ @ SylverReZ:
    Chilli dog
  • Skelletonike @ Skelletonike:
    Damn, I'm loving the new zelda.
  • xtremegamer @ xtremegamer:
    loving the new zelda, i started a game, it was so fucking good, so i
    am waiting on my friend to get home so we can start a new one together
  • Skelletonike @ Skelletonike:
    I just dislike that they don't let me choose the voices before the game starts. Happened with botw as well, had to change to japanese and restart.
  • K3N1 @ K3N1:
    But the important question is can you choose gender
  • Skelletonike @ Skelletonike:
    Same way you can choose Gerald's gender.
  • Skelletonike @ Skelletonike:
    *Geralt, damn autocorrect.
  • Psionic Roshambo @ Psionic Roshambo:
    But can he be trans? Lol
  • K3N1 @ K3N1:
    Zelda transforms into link
  • Psionic Roshambo @ Psionic Roshambo:
    Link I'm not the princess your looking for.... *Pulls a crying game*
  • K3N1 @ K3N1:
    *skirt up* it's exactly what I always wanted
  • Skelletonike @ Skelletonike:
    Just scanned all my zelda amiibos, took a while but didn't get anything that cool, did get the lon lon ranch hylian fabrics though.
  • Skelletonike @ Skelletonike:
    It was pretty funny when I scanned wolf link and got a shit load of meat.
  • K3N1 @ K3N1:
    @Skelletonike, btw I ran that custom for mgs4 on the deck I'm amazed it got that far in game
  • K3N1 @ K3N1:
    Plug in*
    K3N1 @ K3N1: Plug in*