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/9d66FYg

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,

MushCow

New Member
Newbie
Joined
May 7, 2019
Messages
4
Trophies
0
Age
34
XP
91
Country
Germany
The Switch has a type of CPU called ARM64 more similar to the one in your phone than in a desktop or laptop. Because of that many programs aren't designed with it in mind or the ability to run. I believe that there is a way to run such programs regardless but with a big hit to performance, speed, etc.
And for the note: You can switch to the "Switch OS" and play there.

The interesting part is streaming und much more. Netflix, Amazon Prime or Kodi ...

I hope anyone can find a way to include widevine or DRM. :)
 
  • Like
Reactions: trohn_javolta

Ghost92

Well-Known Member
Member
Joined
Jun 29, 2017
Messages
1,100
Trophies
0
Age
29
XP
1,625
Country
Colombia
The Switch has a type of CPU called ARM64 more similar to the one in your phone than in a desktop or laptop. Because of that many programs aren't designed with it in mind or the ability to run. I believe that there is a way to run such programs regardless but with a big hit to performance, speed, etc.
I thought that with running Ubuntu and ran anything throws in linux. Since the same operating system, aaptado to arm64, would be responsible for interpreting the game for that processor.

So can only play pure emulator?
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
32
XP
560
Country
United States
And for the note: You can switch to the "Switch OS" and play there.

The interesting part is streaming und much more. Netflix, Amazon Prime or Kodi ...

I hope anyone can find a way to include widevine or DRM. :)

I have had a linux build for a year that plays netflix in kodi 18. You cant easily install kodi18 in l4t ubuntu, as the build enviornment is a pain to set up, as the ppa is all for X86_64. :( I am working on an l4t-gentoo build now, but I think I am stuck with a 64 bit os. Not a big deal, as I plan on creating a 32bit chroot just for kodi on this build. It sucks, as there is no multilib arm setup, so you have to build a 64bit system to get the drivers to work, and a 32bit chroot, basically set up the same way, with the apps installed in it that wont run on arm64(Such as libwedevine library to decrypt drm streams.) It is a work in process, and my computer isnt the fastest, but if I can get it to work, I will post a basic stage 4 here, at least for the arm64 stuff.
 

trohn_javolta

Active Member
Newcomer
Joined
Aug 9, 2018
Messages
25
Trophies
0
Age
41
XP
94
Country
Antigua and Barbuda
I have had a linux build for a year that plays netflix in kodi 18. You cant easily install kodi18 in l4t ubuntu, as the build enviornment is a pain to set up, as the ppa is all for X86_64. :( I am working on an l4t-gentoo build now, but I think I am stuck with a 64 bit os. Not a big deal, as I plan on creating a 32bit chroot just for kodi on this build. It sucks, as there is no multilib arm setup, so you have to build a 64bit system to get the drivers to work, and a 32bit chroot, basically set up the same way, with the apps installed in it that wont run on arm64(Such as libwedevine library to decrypt drm streams.) It is a work in process, and my computer isnt the fastest, but if I can get it to work, I will post a basic stage 4 here, at least for the arm64 stuff.

Nice, thx for your work!
 

Drban789

Well-Known Member
Member
Joined
Jun 28, 2018
Messages
105
Trophies
0
XP
361
Country
United Kingdom
I'm waiting like crazy for Android on the Switch now, then it's even more perfect!

Is there people working on it atm or your just hoping? Because ubuntu is really weird for me lol. Andriod will be perfect the OS is so light and stable. And so much stuff for it.
 

xdarkmario

Philosopher
Member
Joined
Dec 30, 2010
Messages
1,586
Trophies
0
Location
Mushroom Kingdom
XP
2,124
Country
United States
the keyboard dosent popup when i need it to, it seems to do what it wants. can i make it popup whenever i need it to?


EDIT: found it all the way at the top of the screen in that little 4 panel square on top. (its small so you may need a stylus to tap)
 
Last edited by xdarkmario,
  • Like
Reactions: Csmrcc

KuranKu

I am KranK
Developer
Joined
Jan 13, 2019
Messages
369
Trophies
0
Age
31
Location
Israel
XP
1,127
Country
Israel
the keyboard dosent popup when i need it to, it seems to do what it wants. can i make it popup whenever i need it to?


EDIT: found it all the way at the top of the screen in that little 4 panel square on top. (its small so you may need a stylus to tap)
the small 4 cubes icon on the right top side of the panel just beside all the other icons such wifi ...
 
  • Like
Reactions: xdarkmario

ZeroFX

why?
Member
Joined
Jun 18, 2018
Messages
440
Trophies
0
Location
napaJ
XP
1,260
Country
Japan
anyone else got dual boot working with horrizon OS and this ubuntu on the same SD? i have somewhat a "dualboot" but its far from practical.
This was already answered, search for the keyword partition or dd or whatever in this post :).

nevermind, i got for ya.
pietempgba said:
I figured out a way to dual boot horizon os and Ubuntu. You can flash the SD image and copy the 1.2 files over then you can move the second partition down and resize it up then you can resize the 1st partition and it can be used with the switch and you can copy all your switch files over. You can only really do this with gparted so you'll have to setup a vm, install it or use another different way of doing it
 
Last edited by ZeroFX,

Drban789

Well-Known Member
Member
Joined
Jun 28, 2018
Messages
105
Trophies
0
XP
361
Country
United Kingdom
Hello, im struggling to install snapd for the switch. I wanted to install acestream player, however I keep getting the same error "system does not fully support snapd:cannot mount sqaushfs image using "squashfs: mount: /tmp/sanity-mountpoint-322799071: unknown filesystem type 'squashfs'."

I am guessing because this version of unbuntu is modified? as snap should already work for this version
 

ZeroFX

why?
Member
Joined
Jun 18, 2018
Messages
440
Trophies
0
Location
napaJ
XP
1,260
Country
Japan
Hello, im struggling to install snapd for the switch. I wanted to install acestream player, however I keep getting the same error "system does not fully support snapd:cannot mount sqaushfs image using "squashfs: mount: /tmp/sanity-mountpoint-322799071: unknown filesystem type 'squashfs'."

I am guessing because this version of unbuntu is modified? as snap should already work for this version
you have to rebuild the kernel, adding Squashfs support, someone already discussed about this and theres even a script for building the kernel above, oh and this is a fully fledged ubuntu, its just a different architecture.
 
Last edited by ZeroFX,

Drban789

Well-Known Member
Member
Joined
Jun 28, 2018
Messages
105
Trophies
0
XP
361
Country
United Kingdom
you have to rebuild the kernel, adding Squashfs support, someone already discussed about this and theres even a script for building the kernel above, oh and this is a fully fledged ubuntu, its just a different architecture.

I saw it but i just dont get it lol. Says i need another linux machine to do it etc. i only have the switch with ubuntu on it. No clue what to do
 
  • Like
Reactions: ZeroFX

enzobelmont

Active Member
Newcomer
Joined
Apr 30, 2019
Messages
29
Trophies
0
Age
44
XP
545
Country
Mexico
is there a .deb with nvidia driver?
I am asking this because upgraded all distro and now i can not inialize graphic driver.
Reviewing Xorg log it says that there is a problem with DRI.
 

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
32
XP
560
Country
United States
As the person that wrote the script, I can say that it should be buildable on the switch. I personally run linux on my computer anyway, hince why I would say a linux computer. Attached is a version that should work on the switch, assuming you have a sane build enviornment.

To build this on the switch, you must have a full gcc enviornment.... Google how to install it on ubuntu, I run gentoo, so I am not going to look into it.

Step 1: Download Attached txt file
Step 2. open terminal
Step 3. type: mkdir -p ~/kernel; mv ~/Downloads/l4t_kernel_prep.txt ~/kernel/l4t_kernel_prep.sh; chmod +x ~/kernel/l4t_kernel_prep.sh
Step 4. type: cd kernel/
Step 5. type. ./l4t_kernel_prep.sh
Step 6. type: cd kernel/kernel-4.9
This will run the script and set up the Switch default config.

To change settings, type: make menuconfig
To Build, type: make -j5 tegra-dtstree="../hardware/nvidia/"
To install modules type: make modules_install

To install you need to mount boot partition, so
type: mount /dev/mmcblk0p1 /boot; cp arch/arm64/boot/Image.gz /boot/l4t-ubuntu/Image; cp arch/arm64/boot/dts/tegra210-icosa.dtb /boot/l4t-ubuntu/tegra210-icosa.dtb; umount /boot
 

Attachments

  • l4t_kernel_prep.txt
    3.6 KB · Views: 141
  • Like
Reactions: globalc

Drban789

Well-Known Member
Member
Joined
Jun 28, 2018
Messages
105
Trophies
0
XP
361
Country
United Kingdom
As the person that wrote the script, I can say that it should be buildable on the switch. I personally run linux on my computer anyway, hince why I would say a linux computer. Attached is a version that should work on the switch, assuming you have a sane build enviornment.

To build this on the switch, you must have a full gcc enviornment.... Google how to install it on ubuntu, I run gentoo, so I am not going to look into it.

Step 1: Download Attached txt file
Step 2. open terminal
Step 3. type: mkdir -p ~/kernel; mv ~/Downloads/l4t_kernel_prep.txt ~/kernel/l4t_kernel_prep.sh; chmod +x ~/kernel/l4t_kernel_prep.sh
Step 4. type: cd kernel/
Step 5. type. ./l4t_kernel_prep.sh
Step 6. type: cd kernel/kernel-4.9
This will run the script and set up the Switch default config.

To change settings, type: make menuconfig
To Build, type: make -j5 tegra-dtstree="../hardware/nvidia/"
To install modules type: make modules_install

To install you need to mount boot partition, so
type: mount /dev/mmcblk0p1 /boot; cp arch/arm64/boot/Image.gz /boot/l4t-ubuntu/Image; cp arch/arm64/boot/dts/tegra210-icosa.dtb /boot/l4t-ubuntu/tegra210-icosa.dtb; umount /boot

Thank you for the thorough guide. I will follow it and report back. Thank you again
 
  • Like
Reactions: ZeroFX

Gavin_Darkglider

Well-Known Member
Member
Joined
May 20, 2019
Messages
232
Trophies
0
Age
32
XP
560
Country
United States
For what it is worth, I would back up the l4t-ubuntu folder on the fat32 partition before I tried this, as if the build doesnt work, you can get back to a working build easier. I just tested it as far as getting it to build. When I tried to use it with my arm32 gentoo build, it booted, but because there is no framebuffer driver, and I cant install the l4t xorg driver, it was useless. I didnt test it on l4t ubuntu, as I wasnt happy with ubuntu(Dont like apt, especially for aarch64 choices). When I am done with my build, it should give more options, such as kodi 18, with working netflix(maybe, via 32bit chroot, not sure about gfx driver stuff though), as I have had that for months using the old linux kernel. As for android, until there is a framebuffer driver, L4T kernel is almost useless, as the blobs are for x11, hince why the first thing on the screen once the console boots is the nvidia logo, which can actually be disabled, with an extra config option in xorg.conf. lol.
 
Last edited by Gavin_Darkglider,

Drban789

Well-Known Member
Member
Joined
Jun 28, 2018
Messages
105
Trophies
0
XP
361
Country
United Kingdom
For what it is worth, I would back up the l4t-ubuntu folder on the fat32 partition before I tried this, as if the build doesnt work, you can get back to a working build easier. I just tested it as far as getting it to build. When I tried to use it with my arm32 gentoo build, it booted, but because there is no framebuffer driver, and I cant install the l4t xorg driver, it was useless. I didnt test it on l4t ubuntu, as I wasnt happy with ubuntu(Dont like apt, especially for aarch64 choices). When I am done with my build, it should give more options, such as kodi 18, with working netflix(maybe, via 32bit chroot, not sure about gfx driver stuff though), as I have had that for months using the old linux kernel. As for android, until there is a framebuffer driver, L4T kernel is almost useless, as the blobs are for x11, hince why the first thing on the screen once the console boots is the nvidia logo, which can actually be disabled, with an extra config option in xorg.conf. lol.

the script is running atm but im not gonna setup switch the default or install it. lol i have no idea whats going on. ill let the other experienced members run it first then ill follow suite. :D
 
General chit-chat
Help Users
    KennieDaMeanie @ KennieDaMeanie: Don't know which is worse