Skip to content

Instantly share code, notes, and snippets.

@crc-32
Last active May 11, 2018 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crc-32/89c2c64383dcbc3813902e7e4fabcb10 to your computer and use it in GitHub Desktop.
Save crc-32/89c2c64383dcbc3813902e7e4fabcb10 to your computer and use it in GitHub Desktop.

Simplest guide to getting your Switch running linux, from a VM user's perspective First, you will need to download Ubuntu, here's a link (this file is quite large): http://releases.ubuntu.com/18.04/ubuntu-18.04-desktop-amd64.iso Putting your Switch into RCM/Recovery mode is out of the scope of this tutorial

  1. Download VMWare and install
  2. Open VMWare, click File --> New --> Virtual Machine…
  3. A window will appear, click Typical then Next.
  4. Choose Installer Disc image file (ISO) then click Browse... and open your Ubuntu file you downloaded earlier
  5. Press Next until you see a screen with the title Specify Disk Capacity, it's up to you what size you want your disk to be for ubuntu but I suggest around 40.0, after you've decided this, choose Store virtual disk as a single file and then click Next
  6. Enter the details you want to use to login to the Ubuntu VM then click Next. Don't forget them!
  7. Press Next until you see the checkbox Power on this virtual machine after creation near the bottom of the window.
  8. Make sure the checkbox for this is ticked, then click Finish
  9. The VM will now automatically start up. Use the arrow keys to select the text Install Ubuntu (make it white) and hit enter. You may have to click the screen of the virtual machine to start controlling it.
  10. Go through the installation process, your language may not make a difference but I'd suggest using English as it's what I used to complete this tutorial. If the installer asks for you to enter a username and password, simply enter the same details you used in step 6 and ignore Computer's name
  11. Once the installation finishes, you will be met with a message saying Installation has finished, in VMWare, press VM --> Settings (or equivalent), find USB settings and ensure that the dropdown (which usually says USB 2.0 says USB 3.0. Your VM may now reboot, if it doesn't, press Restart Now.
  12. Once the VM restarts, enter your password to login and click the 6 squares on the bottom left hand corner of the VM's screen (in the dock), and type 'Terminal'.
  13. Click on the result named Terminal and type the following (don't paste it in, type it line by line): sudo apt install python3, you will be asked for the password of your account, type it in (the password won't show up as you type at all) pip3 install pyusb git clone https://github.com/SoulCipher/shofel2_linux.git cd shofel2_linux
  14. This is the stage where we test if you have the VM setup correctly so far, plug in your Switch into a USB 3.0 SS (Usually a blue coloured socket) socket on your computer and put your switch into RCM/Recovery mode.
  15. Wait a few seconds, then under VM --> Removable Devices find a device containing APX or Nvidia and click it, then click Attach or equivalent (this term differs through different versions of VMWare)
  16. Click back into the VM, then type sudo ./boot_linux.sh into your Terminal window.
  17. Your switch should show penguins at some point, then either reboot (handily back to RCM) or say waiting for ..., in which case hold down the power button for 13 seconds so the Switch turns off, and then boot it back into RCM. Phew, first half of tutorial complete Now, you need to obtain a 'rootfs', these are the linux 'distributions' that can be run by the Switch. Choose one from: Archlinux LXDE rootfs (min 8gb SD): https://drive.google.com/open?id=1VIH3GWtBrM4uuVQOQopASYZy4x3Jw1Uv (Suggested option) Archlinux gnome rootfs: https://0w0.st/gnome__rootfs.tar.bz2 Ubuntu rootfs: https://mega.nz/#!M8sUzDgR!_BhgNd878hio-wX7W324QU6TLjS9zTs38aNDNThTlv0 You can choose others, but these are the current best options (IF THIS IS A ZIP, NOT TAR, EXTRACT IT FIRST) Download these through Ubuntu's built-in firefox browser to your VM. Once the download is done, we can continue:

If you chose the LXDE rootfs (or any with the file extension .bin or .img inside their zip) 18. Plug your sdcard into your PC, it needs to be at least 8gb and will be wiped in the process, so back anything you already have on it up. 19. Through the same VM --> Removable Devices menu, attach the sdcard to the VM. 20. Click the 6 squares on the bottom left again, and search for/open Disks 21. Select the disk which is your sdcard from the left hand list 22. On the top-right, click the '3 lines' icon and then click Restore Disk Image... 23. In the window that opens up, click (None) and then open your .bin or .img file, you may need to extract it out of a zip and/or type * and hit enter in the filename box to view all file types. 24. Click Start Restoring... and click OK to any warnings or errors about it being a different size. THIS STEP WIPES THE SDCARD COMPLETELY 25. Wait a while for the rootfs to be flashed to the SD (OBVIOUSLY DON'T REMOVE THE SDCARD AT THIS POINT) 26. Once this is done, press the 'eject' button on the top right (next to the 3 lines, it has an arrow going up), close Disks and your SD will be ready! 27. Remove the SD from your computer and place it in the Switch (which should still be in RCM mode) 28. You can now re-type the command sudo ./boot_linux.sh in Terminal in order to boot linux on the switch!

If you chose the Ubuntu or Gnome rootfs (or any that has .tar in the name somewhere) 18. Plug your sdcard into your PC, it needs to be a sensible capacity and will be wiped in the process, so back anything you already have on it up. 19. Through the same VM --> Removable Devices menu, attach the sdcard to the VM. 20. Click the 6 squares on the bottom left again, and search for/open Disks 21. Select the disk which is your sdcard from the left hand list 22. On the top-right, click the '3 lines' icon and then click Format Disk... 23. Ensure the top option says Don't overwrite existing data and the bottom option says Compatible with all systems and devices. 24. Press Format... THIS STEP WIPES THE SDCARD COMPLETELY 25. Wait a few seconds for the SDCard to format, then press the + button underneath the large orange rectangle 26. Again, make sure the 2 dropdowns say the correct things like in step 23 27. Where it says Partition Size choose the size you want the official switch OS to use, remember linux will need alot too, usually more than this amount. 28. Press Create and wait for the orange box to split 29. Click on the white area to the right of the orange box, and press + again. 30. This time, the second option (Which was Compatible with all systems and devices) now needs to say Compatible with Linux systems 31. Press Create 32. Press the play icon which has now replaced the + icon 33. Right at the bottom of the text, where it says Contents right click the orange text to the right of Mounted at and click Copy Link Address 34. Press the 6 squares at the bottom left hand side of your VM screen and search for/open another Terminal 35. In this terminal, type cd Downloads 36. type tar -xf (NAME OF DOWNLOADED ROOTFS) -C (MOUNT POINT) where (name of rootfs) is the name of the file you downloaded and (mount point) is the link you copied earlier, but remove the file:// from it (you can't use ctrl+v, just right click and then click paste) 37. Wait a while, nothing will show up in the Terminal it'll just ask for a command again once it's done extracting 38. When it's done, go back to Disks and press the 'eject' button (next to the 3 lines on the top right, it has an arrow pointing up), wait for the notification on the top right to say something like 'Device can be safely removed' and then remove your sdcard! 39. Put the sdcard back into your Switch (which should still be in RCM mode) 40. You can now re-type the command sudo ./boot_linux.sh in the original Terminal in order to boot linux on the switch!

From now on, to boot linux, connect your Switch to the PC, ensure the device is attached to the VM, open a new Terminal from the 6 square menu and type:

cd shofel2_linux
sudo ./boot_linux.sh

then enter your password, and linux will boot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment