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,
D

Deleted User

Guest
Retroarch crashes on startup and trying to do so through terminal returns
SEGMENTATION FAULT (core dumped)

Tried uninstalling, reinstalling, changing things in the cfg file. Nothings working.

I've reflashed my SD and started fresh, it still segfaults, I've not yet got it running on the switch.
Followed the ubuntu compilation docs on libretro
I did a test run on a VM which works fine
 
D

Deleted User

Guest
That's... really strange.

I mean, I had it working, I just started changing settings trying to get handheld mode to have the same performance I was seeing in docked mode.

Strange.... very strange indeed.
 
D

Deleted User

Guest
I know dude, I'm stumped and trying not to whimper for help about it
I'm gonna try making a swapfile and if that doesn't work I'll put it aside for a bit, there's other emulators I can get my fill with in the meantime
 

Torrey187

New Member
Newbie
Joined
May 1, 2019
Messages
3
Trophies
0
Age
30
XP
40
Country
United States
That's... really strange.

I mean, I had it working, I just started changing settings trying to get handheld mode to have the same performance I was seeing in docked mode.

Strange.... very strange indeed.
I can give this a try at home when I’m out of work if you want. And see if the same happens for me.
 
D

Deleted User

Guest
I can give this a try at home when I’m out of work if you want. And see if the same happens for me.
Please do, i'd appreciate it.

I was using stock speeds, but it's strange how it was so perfect in docked, but easily 15% speed in handheld. Figure that's some settings I missed, cus folks are playing frigging gamecube games in handheld mode.
 
D

Deleted User

Guest
Yeah dolphin for me is pretty good, it's not quite fullspeed on what little games I own but then I'm not using ishiruka (yet) and of course people are saying it's faster
With little to no configuration handheld mode is fine for me, it's just this one hurdle I'm lacking the smarts to get past.
 

orangpelupa

Well-Known Member
Member
Joined
Aug 7, 2009
Messages
385
Trophies
0
XP
1,141
Country
Indonesia
Bug reports

- usb hub (rh 888) doesn't work (with dock)
- usb harddisk spins but not detected (with dock)
- dnscrypt can't be installed. I suspect its because the Linux network system automatically use dnscrypt before it can acquire the initial certs/settings. Because right after dnscrypt got installed, all dns request can't be resolved. Despite in the network setting its not using dnscrypt yet

Correction. Usb hdd works when plugged to the bottom USB.

EDIT:

cant install VLC


sudo snap install vlc
[sudo] password for raden:
error: system does not fully support snapd: cannot mount squashfs image using
"squashfs": mount: /tmp/sanity-mountpoint-351562362: unknown filesystem
type 'squashfs'.
 
Last edited by orangpelupa,

v311403

Member
Newcomer
Joined
May 1, 2019
Messages
5
Trophies
0
Age
41
XP
102
Country
United States
I tried cross compiling the kernel using just the following in the linux-switch repo on the switch-dev branch:

export ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
make nintendo_switch_defconfig
make dtbs
make -j93

It worked but the image was only 24M compared to your 27M and didn't boot. I read your instructions before but not sure what you mean for us to do with the manifest file. Is the linux-switch repo not a self contained repo? I imagine one needs to overlay repos or build using some kind of l4t script/toolchain? Sorry, but I haven't worked with l4t before. Would be interested in contributing. Thanks.
 
  • Like
Reactions: iotdevnet

Qubarf

Well-Known Member
Member
Joined
Dec 14, 2018
Messages
233
Trophies
0
Age
32
XP
854
Country
Pakistan
Guys, has anybody installed Qjoypad yet?
Several people have asked this and little to no help has been given.
If i could use the joy-cons to control the mouse would help so much for the portability factor, thank you!
 
  • Like
Reactions: crow132

iwillbyte

New Member
Newbie
Joined
May 1, 2019
Messages
2
Trophies
0
Age
27
XP
74
Country
United States
I have spent some time trying to get Ishiiruka's Vulkan option to show up in the graphics settings but it is stuck on OpenGL. I have compiled it a few times in different ways and reinstalled L4T in-between and can't think of anything else to try. Any ideas? Btw, this is an awesome project and can't wait to see where it goes from here!

It is compiled with everything looking right except for the 'Backend' dropdown only having the one option.

Edit: I used my Android device as a mouse and I was able to select "Vulkan (experimental)"! Thank you Felipe_9595 for telling me about DroidMote.
 
Last edited by iwillbyte,

bylaws

Well-Known Member
OP
Member
Joined
Dec 11, 2018
Messages
129
Trophies
0
XP
1,144
Country
United Kingdom
Managed to break it attempting to install moonlight. Was probably something I did to be honest my linux skills are non-exsistent.

Tried to install it from the repo provided by moonlight got a "cant install snap store cant support snapd/ linux can't mount image squashfs image using squashfs mount" error. Then installed snap (seemingly worked fine) and then tried to install moonlight again and got the same error. Restarted L4T and now switch hangs on a black screen before resetting back to RCM.

Might format the SD card and try again, make sure it's not something I've missed. Anyone got any ideas?

Edit: Also, not sure if this is a known error but I got no touchpad popup when using the browser, this was the only place that it happened.

European version or NTSC? All rips I seem to be able to get are NTSC.

And let me ask, since alot will probs ask too. How did you overclock to 1.7?

Edit: Oh, I just had an idea! Is there a way we can get the devices IP address printed to the taskbar up the top of the screen? It would be REALLY handy for those folks who wish to SSH and FTP to the switch, and ip's change whenever you go elsewhere, and sometimes just because.
Read info section.
It's in WiFi menu iirc.
Correction. Usb hdd works when plugged to the bottom USB.

EDIT:

cant install VLC


sudo snap install vlc
[sudo] password for raden:
error: system does not fully support snapd: cannot mount squashfs image using
"squashfs": mount: /tmp/sanity-mountpoint-351562362: unknown filesystem
type 'squashfs'.
Don't use snnaps
I tried cross compiling the kernel using just the following in the linux-switch repo on the switch-dev branch:

export ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
make nintendo_switch_defconfig
make dtbs
make -j93

It worked but the image was only 24M compared to your 27M and didn't boot. I read your instructions before but not sure what you mean for us to do with the manifest file. Is the linux-switch repo not a self contained repo? I imagine one needs to overlay repos or build using some kind of l4t script/toolchain? Sorry, but I haven't worked with l4t before. Would be interested in contributing. Thanks.
Look back a bit in post, I gave how to do it.the defconfig name is different aswell
 

Felipe_9595

Well-Known Member
Member
Joined
Dec 26, 2010
Messages
370
Trophies
0
XP
621
Country
Cote d'Ivoire
If you guys wanna have a better input method in the meanwhile, I recommend using DroidMote, works flawlessly with almost 0 lag
 

Kolyasisan

Well-Known Member
Newcomer
Joined
Nov 16, 2013
Messages
77
Trophies
0
Location
Moscow
XP
704
Country
Russia
I feel that my reply has been completely missed, so I will post it again.

Strangely, can't get it to boot on my switch. The installer never shows, the screen is just completely black. Tried multiple times with different image burning tools, ensured to give it plenty of time to boot.
 

Techjunky90

Well-Known Member
Member
Joined
Apr 7, 2017
Messages
487
Trophies
0
Age
32
XP
872
Country
United States
I feel that my reply has been completely missed, so I will post it again.

Strangely, can't get it to boot on my switch. The installer never shows, the screen is just completely black. Tried multiple times with different image burning tools, ensured to give it plenty of time to boot.
Your reply is probably being ignored because the issue you are having has already been reported here.
 

Felipe_9595

Well-Known Member
Member
Joined
Dec 26, 2010
Messages
370
Trophies
0
XP
621
Country
Cote d'Ivoire
I feel that my reply has been completely missed, so I will post it again.

Strangely, can't get it to boot on my switch. The installer never shows, the screen is just completely black. Tried multiple times with different image burning tools, ensured to give it plenty of time to boot.
Did you apply the 1.1 update before booting? OP says there are SD card compatibilities issues without it
 

NazoKermit

New Member
Newbie
Joined
Mar 1, 2019
Messages
4
Trophies
0
Age
18
XP
57
Country
Australia
New to this and I cannot get wine because it says I'm not connected to the internet. Also, I can't get dolphin because I guess I'm just stupid and it's really finicky.
 

wicksand420

Well-Known Member
Member
Joined
Nov 13, 2016
Messages
2,801
Trophies
1
Age
38
XP
2,284
Country
United States
For qjoypad you open the terminal and type

sudo apt-get update -y and hit enter

then this

sudo apt-get install -y qjoypad and hit enter

then to configure it, make sure your joycons are paired, then in the terminal type

qjoypad --notray and hit enter

A controller icon will appear, click on it to configure the controllers
 
General chit-chat
Help Users
    Skelletonike @ Skelletonike: and building gundams out of nowhere +2