Rabu, 03 Juli 2024

FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

We have a new tutorial series and this one is on WSL. With WSL, people can use Linux command line inside Windows. It is a popular tool among students and developers. Many people are getting their first experience of Linux commands with WSL so it was about time that we created some good resources on it.

It's FOSS WSL series covers all the essentials in nine tutorials.

Using Linux With WSL on Windows
Get started with Linux within the comfort of your Windows system with WSL. Learn the essential WSL concepts.
FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

You can find the series on the homepage along with Terminal Basics and Bash series. I hope you enjoy these tutorial series as much as we like creating them 😄

💬 Let's see what else you get in this edition

  • A simple markdown note-taking app.
  • Proton VPN being made more accessible.
  • The Raspberry Pi 5 being humbled by another SBC.
  • EndeavourOS celebrating their five-year anniversary.
  • And other Linux news, videos and, of course, memes!

🛒 Don't miss this ebook deal

Somehow I missed this awesome Linux ebooks deal on Humble Bundle. Now it has only four days remaining. It has some good books in the collection, including the latest edition of Linux Pocket Guide. Do check it out.

Humble Tech Book Bundle: Linux for Seasoned Admins by O’Reilly
Get 15 books from O’Reilly on a range of topics, including DevOps, containerization, version control with Git & more! Your purchase helps Code for America.
FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

📰 Linux news

Eclipse Plans to Challenge Microsoft’s VS Code Dominance With Theia Code Editor
A powerful open-source IDE appears.
FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

🧠 What we’re thinking about

An interesting read on how tech went from free goodness to a more pay-per-day affair.

How tech went from free love to pay-per-day
FOSS, AI, blockchain, and the cycle of empty nonsense
FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

🧮 Linux Tips, Tutorials and More

The ArmSom Sige7 has some seriously beefed-up hardware on the tiny board.

This SBC Puts Raspberry Pi 5 to Shame
Cheeky headline apart, ArmSom Sige7 is actually a pretty impressive device.
FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

Get more out of LibreOffice with these tips.

15 LibreOffice Tips to Get More Out of it
LibreOffice is an excellent office suite. These LibreOffice tips will enable you to use it more effectively.
FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

In case you were wondering what Ollama is.

What is Ollama? Everything Important You Should Know
Answering the common questions about Ollama.
FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

📹 Video tutorial

Ever been curious about what happens when you run the dreaded rm -rf / command? Let me show that to you.

✨ Project highlights

Safe Space makes storing important files easy.

An Open-Source Android App That Simplifies Storing Important Files
Pretty simple, and a nifty open-source tool for Android.
FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

Another note-taking app has surfaced, it's Folio, which is a simple markdown note app for Linux.

Folio: A Simple, Solid, Open-Source Markdown Note App
I think this is a wonderful markdown note-taking app, try it out!
FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

🧩 New quiz

Familiar with Fedora's history? This quiz will help refresh your memory.

The Fedora Side of Linux: Quiz
Fedora has an interesting history. Take this quiz to find out a little more about it.
FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

💡 Quick handy tip

In Firefox, you can force the websites to use custom fonts. First open settings, then under the General tab, scroll down to the Fonts section.

FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

Here, click on Advanced, where you can set different font categories here. Now, uncheck the “Allow pages to choose their own fonts…” checkbox, and click OK.

FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

Now, sites will load with your selected fonts.

🚧
Don't use this if you are working with graphics and font related things. Because apps like Canva, online Office suites etc. won't show other fonts.

🤣 Meme of the week

A meme that reflects the current state of open-source contributions. 😥

FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

🗓️ Tech Trivia

Bell Labs held a press conference in New York to show off the first point-contact transistor on June 30, 1948. It marked a turning point in how technology moved forward.


🧑‍🤝‍🧑 FOSSverse corner

An interesting thread by one of our dedicated FOSSers, Rosika, who was wondering about the security of using a clipboard for inserting sensitive information into the browser.

Question regarding clipboard security
Hi all, 👋 I have a question regarding the “security” of using the clipboard for inserting sensitive information in the browser. Here´s the background to my question. When doing my online banking I´m supposed to enter my username on the bank´s online-banking page. This is the first step. Then - in order to complete the login process - I have to enter my personal password (2nd step). This is a very long one, in order to meet the demands set up by the banking institute. 😉 In order…
FOSS Weekly #24.27: WSL Series, Theia Editor, Deepin Linux's AI Assistant and More

❤️ With love

Share it with your Linux-using friends and encourage them to subscribe (hint: it's here).

Share the articles in Linux Subreddits and community forums.

Follow us on Google News and stay updated in your News feed.

Opt for It's FOSS Plus membership and support us 🙏

Enjoy using Linux 😄



from It's FOSS https://ift.tt/hkjqbp4
via IFTTT

Remove a Distro via WSL

Remove a Distro via WSL

Once you have WSL setup, installing various Linux distribution is as simple as installing any application from the Microsoft Store.

This flexibility allows you to experiment with various available distros. And when you have several distros installed via WSL, it only makes sense to get rid of the ones you don't want to use.

Removing a Linux distro installed via WSL involves these two steps:

  • Use the wsl command to unregister a distro from the terminal.
  • Uninstall the WSL distribution app from your system.
💡
Before removing a critical WSL Linux distribution, please ensure that you have a backup of that one, to avoid data loss.

Step 1: Unregister the WSL distribution using the terminal

Here, we will take a look at unregistering a WSL distribution from the terminal and also from within another WSL distribution.

Unregister the distribution using Windows terminal

Before uninstalling a WSL distribution, we need to unregister it. This is to ensure a proper removal of the distribution and its files.

Search and open PowerShell from the Start menu.

Remove a Distro via WSL
Open PowerShell

On PowerShell, use the command below to list all the installed distributions. You will get the name of the distribution you want to remove from this list. Note it.

wsl -l -v

Now, to unregister a distribution, use the command:

wsl --unregister <distro_name>

For me, I will run:

wsl --unregister Ubuntu
Remove a Distro via WSL
Unregister a WSL distribution

This will remove the associated file system and other leftovers.

Unregister a Linux distribution from within another distribution

It is possible to unregister a WSL distribution while you are using another WSL distribution, with the help of the wsl.exe command. What you have to do is to replace wsl in the above-mentioned commands with wsl.exe That is:

List installed distributions using:

wsl.exe -l -v
Remove a Distro via WSL
List installed distributions from within another wsl distribution

Now, remove the selected distro using:

wsl.exe --unregister <distro_name>
Remove a Distro via WSL
Unregister a distribution from within another distribution

Step 2: Uninstall the WSL Distribution from the system

Once you have unregistered the WSL distribution, it is time to remove it from your system.

Since the WSL distributions are installed as apps from Microsoft store, you can uninstall the app to get rid of that distribution. First, press the Windows key to open the start menu and search for the distribution that you want to uninstall.

Remove a Distro via WSL
Search for Ubuntu

Now, right-click on it and select Uninstall.

Remove a Distro via WSL
Select Uninstall

If asked for a confirmation, confirm the uninstall and done.

Alternatively, on the start menu, search and open Installed Apps.

Remove a Distro via WSL
Search for Installed Apps

Inside this, scroll down to find the distribution and click on uninstall to remove it from the system.

Remove a Distro via WSL
Select Uninstall to Remove the App

That's all about removing WSL Linux distributions from Windows.



from It's FOSS https://ift.tt/9bLWigv
via IFTTT

Backup and Restore WSL Distributions

Backup and Restore WSL Distributions

When you are exploring Linux, sometimes you make changes that have unintended consequences.

You may reinstall Linux easily with WSL, but you'll lose the existing data and configuration you had on it.

Thankfully, WSL allows you to export your Linux distro as a tar file and import it later. This is equivalent to a backup and restore feature.

Let's see how it is done.

Export a WSL Linux distribution

In WSL, you have the option to export a distribution to a TAR file, along with the configurations and settings intact.

First, list all the installed WSL distributions on your system using:

wsl -l -v
Backup and Restore WSL Distributions

As you can see, I have an Ubuntu distribution installed, Ubuntu. You should note the name of the distribution that you want to export. It should be case-sensitive and exact.

Here, I am going to take a backup of Ubuntu.

Step 1: Create a folder for backups and open a terminal there

It will be convenient if you have a dedicated folder to save all the backups. It is not necessary, but can be beneficial. I have created a folder on D: called WSL_backups.

Backup and Restore WSL Distributions
Open terminal

Now, go inside that folder and right-click on a blank space. Select “Open in Terminal” to open a terminal on that directory.

Step 2: Create the backup

Once you are in a terminal, run the command:

wsl --export Ubuntu Ubuntu.tar

This will create a backup of the specified Linux distribution.

Backup and Restore WSL Distributions
Take a backup

The general syntax is:

wsl --export <distribution_name> <filename.tar>

Where, the distribution_name should be the same as the output of the wsl -l -v command.

If you open that location, you can see that a backup is created, with ~2 GB space.

Import WSL distribution

Now, it's time to import the distribution. Before moving to it, you should make sure that the distribution you are trying to import is completely uninstalled from your system. For this, use the command:

wsl -l -v
Backup and Restore WSL Distributions
No installed distribution
🚧
Do not proceed if the distribution is not uninstalled.

Step 1: Create an installation folder

Similar to the backup, it is wise to create a proper place for all the imported distributions.

Now, open a terminal in the location where you have created the backup file. In my case, it is the WSL_backups folder.

Backup and Restore WSL Distributions
Open terminal

Step 2: Import the distribution

Inside the terminal, run the command,

wsl --import <Distribution Name> <InstallLocation> <FileName>

In my case, I have created a folder on my D Drive called the D:\wsl-installations\Ubuntu folder. So, the command will be:

wsl --import Ubuntu 'D:\wsl-installations\Ubuntu\' .\Ubuntu.tar
Backup and Restore WSL Distributions
Import a distribution

I have used .\Ubuntu.tar as the file name because I am running the wsl command from the directory where the Ubuntu.tar backup file is stored (WSL-backups folder for me).

You have successfully imported the distribution!

To check, use the command wsl -l -v.

Step 3: Open the imported distribution

Once you have imported the distribution, you may not find it in the start menu to open it easily. So, to enter into it open a terminal and use the command:

wsl -d <distribution_name>

OR

wsl -d Ubuntu

This will open the distribution as root user.

Backup and Restore WSL Distributions
Open as root user

If you want to log in as the default user created during installation, either use the command inside the distribution:

su <username>

Or, open the WSL distribution with specified user:

wsl -d <distribution_name> -u <username>

OR

wsl -d Ubuntu -u team

Step 4: Set default user

To log in to the default user each time you open the distribution, you need to edit a configuration file. So, inside the distribution, that is logged in as root, edit the /etc/wsl.conf file.

nano /etc/wsl.conf

If you have logged in as a normal user, you need to use sudo to edit the file. i.e.

sudo nano /etc/wsl.conf

Inside this file, add the following line:

[user]
default = <username>

Fill the <username> with the one you have to log in, that is already on that system.

Backup and Restore WSL Distributions
Change user from root

Once edited, save and exit nano by pressing CTRL + x. Confirm using y and press enter. Now, terminate the system. You can do this from a new Windows terminal:

wsl --terminate Ubuntu

Or, from within that distribution:

wsl.exe --terminate Ubuntu

Thereafter, reopen the distribution using:

wsl ~ -d Ubuntu

This will open Ubuntu with the username you have provided.

💡
The command wsl ~ will open the home directory of the default user, instead of the current Windows directory mounted automatically.

Wrapping up

That's it! You have successfully backed up and restored a WSL distribution. As specified in the above article, backup does consume additional space on your disk.

While you may not back up all the systems you have installed, it is advised to take a backup for those that contain critical data.



from It's FOSS https://ift.tt/9P162Fj
via IFTTT

Access WSL Files in Windows

Access WSL Files in Windows

Among its numerous advantages, one notable feature is the seamless accessibility of Linux files stored within WSL from the Windows operating system itself.

In this article, you'll explore various methods of accessing WSL files. This will enable smooth file management and interoperability between Windows and Linux environments.

You will look at both graphical and command-line ways of accessing WSL files inside Windows.

Access WSL files using Windows Explorer

The most basic way of accessing a file on Windows is by launching the Windows File Explorer. The file manager is present on the taskbar, and you can just open it to browse files. Wait! That is for Windows files, but for Linux?

Yes. WSL indeed stores the file inside Windows because it is the host. If you have set up the WSL correctly on Windows, you will see a Penguin icon on your File Explorer.

Access WSL Files in Windows

Just click on it.

You will see the name of the WSL distributions you have installed currently as folders. I have two; an Ubuntu and an OpenSUSE Tumbleweeed.

Access WSL Files in Windows

Double-click on the one you need to access. Now, you are inside the root directory of that system.

Access WSL Files in Windows
Root directory of WSL distribution

Go inside the home → username folder, and there it is.

Access WSL Files in Windows
Home directory of default user

You are now accessing the home directory of the default user. Double-click on any file to open it on a Windows app. You can see in the screenshot below, I have opened the .bashrc file on Notepad app.

Access WSL Files in Windows
Open .bashrc file in Notepad

Use the address bar of Explorer

You can use the address bar of Windows Explorer to go into the WSL folders. For this, click on the to address bar. When it is changed to editing, enter:

\\wsl$
Access WSL Files in Windows
Enter WSL location in the Address bar

This will bring you to the same folder, where all the WSL distributions are listed as folders. Click on any to enter into it.

Access WSL Files in Windows
Click on a Distribution Name

💡 Tip: Open the current Linux directory location in Windows

Imagine that you are using Linux through the Windows terminal and you are in a specific directory location. Now, you think it would be better if you could access it in the file explorer.

This is possible and quite easy. Enter the following command on the WSL terminal.

explorer.exe .

Here, the . refers to the current directory you are in. This means that your current directory will be opened in the Windows file explorer.

Access WSL Files in Windows
Open current directory in Explorer

Similarly, while inside the WSL, you can specify a directory path to open that folder in Windows Explorer.

Access WSL Files in Windows
Open a directory by specifying the path

As you can see, the mentioned directory is opened in Windows Explorer and you can access the files.

Open a WSL text file in Notepad

While there are terminal-based text editors available in Linux, you may not be comfortable with the idea of editing files in the command line.

Thankfully, you can easily open those Linux text files using Windows's Notepad.

notepad.exe /path/to/the/file/inside/wsl/distribution
Access WSL Files in Windows
Open a WSL file using Notepad

Accessing files between WSL and Windows

As you can easily guess by now, it is possible to access files between WSL and the Windows host operating system.

Here are a few tips on accessing files between Windows and Linux inside WSL.

If you are working on a project inside WSL, be sure to store the files inside the respective WSL system. Similarly, store all the files inside the Windows filesystem if you are working on a project using Windows, you can ensure maximum speed and performance.

Edit Windows files inside WSL

While inside WSL, you can open a file stored on the Windows filesystem using Linux tools like the Nano editor.

For this, we use the Mounted Drive concept.

nano /mnt/c/Users/username/Documents/filename
Access WSL Files in Windows
Edit a Windows file inside WSL

Here, the /mnt/c represents the C drive mounted to the WSL. So, what the command actually does is, open the specified file on the location specified in nano editor.

You can use /mnt/d, if you have a drive located with D: in Windows.

💡
If you are using Windows files from WSL, then read more about their permission settings from the official Microsoft guide.

Copy files between WSL and Windows

Inside the WSL, you can copy a file from WSL to a specified Windows folder. To do that, use the cp command:

cp /home/$USER/filename /mnt/d/Documents/

This will copy the file called filename from the home directory of the user to the Documents folder (if exists) on the D drive.

Access WSL Files in Windows
Copy a file from WSL to a Windows folder

Similarly, if you want to transfer a file from a Windows folder into the WSL system, use:

cp /mnt/d/Documents/filename /home/$USER/
Access WSL Files in Windows
Copy a file from Windows to WSL folder

That's it. You have copied the files.

🚧
Keep caution while managing files between the two operating systems. It can lead to file loses and corruption, if not handled properly.

Wrapping Up

Here, you learned about accessing files between Windows and Linux running inside WSL. The ability to access Linux files easily from Windows is super helpful for Windows users. Let me know if you have any questions.



from It's FOSS https://ift.tt/16iANmX
via IFTTT