Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Tuesday, December 16, 2025

Running Ubuntu on Windows 11 with WSL

Windows Subsystem for Linux (WSL) makes it easy to run a full Linux environment directly on Windows 11. This is great for developers and power users who want Linux tools (e.g. grep, sed, awk, tmux) alongside Windows apps.

This is how you can install Ubuntu on Windows 11:

  1. Open PowerShell in administrator mode by right-clicking and selecting "Run as administrator", run the wsl --install command, and then restart your machine.
  2. Run wsl --list --online to list the distributions that can be installed, as shown below:
    PS > wsl --list --online
    
    The following is a list of valid distributions that can be installed.
    Install using 'wsl.exe --install <Distro>'.
    
    NAME                            FRIENDLY NAME
    AlmaLinux-8                     AlmaLinux OS 8
    AlmaLinux-9                     AlmaLinux OS 9
    AlmaLinux-Kitten-10             AlmaLinux OS Kitten 10
    AlmaLinux-10                    AlmaLinux OS 10
    Debian                          Debian GNU/Linux
    FedoraLinux-43                  Fedora Linux 43
    FedoraLinux-42                  Fedora Linux 42
    SUSE-Linux-Enterprise-15-SP7    SUSE Linux Enterprise 15 SP7
    SUSE-Linux-Enterprise-16.0      SUSE Linux Enterprise 16.0
    Ubuntu                          Ubuntu
    Ubuntu-24.04                    Ubuntu 24.04 LTS
    archlinux                       Arch Linux
    kali-linux                      Kali Linux Rolling
    openSUSE-Tumbleweed             openSUSE Tumbleweed
    openSUSE-Leap-16.0              openSUSE Leap 16.0
    Ubuntu-20.04                    Ubuntu 20.04 LTS
    Ubuntu-22.04                    Ubuntu 22.04 LTS
    OracleLinux_7_9                 Oracle Linux 7.9
    OracleLinux_8_10                Oracle Linux 8.10
    OracleLinux_9_5                 Oracle Linux 9.5
    openSUSE-Leap-15.6              openSUSE Leap 15.6
    SUSE-Linux-Enterprise-15-SP6    SUSE Linux Enterprise 15 SP6
    
  3. Run wsl --install Ubuntu (or another distro of your choice)

That’s it! Ubuntu is now running on your Windows 11 system.

You can now open a Ubuntu terminal by running the wsl command.

You can access your Windows files from /mnt/c. You can also install Ubuntu packages using apt.

Saturday, June 12, 2010

Mounting a Windows Hard Drive on Linux

Today, I had problems with my Windows hard drive. The operating system (XP) refused to start up and was complaining about corrupt system files. I wanted to back up my files in case things got worse. Luckily, I have a USB external hard drive enclosure and an Ubuntu Linux netbook so this is what I did:
  • I took out the hard drive from my Windows laptop.
  • I inserted it into my Akasa Integral External Enclosure and plugged it via USB into my Ubuntu netbook.
  • Ubuntu wasn't about to mount it automatically and gave me an error saying that the hard drive had problems and that I should "force" it to mount using a command.
  • I opened a terminal and typed the following commands to mount the disk manually:
  • $ sudo mkdir /media/disk
    $ sudo mount -t ntfs /dev/sdb1 /media/disk -o force
    $ cd /media/disk
    
  • I was then able to browse the contents of the Windows drive and back up important files.
  • Finally, I unmounted the drive as follows:
  • $ sudo umount /dev/sdb1
    

Tuesday, April 28, 2009

Setup Samba on Ubuntu

Here is a quick guide to setting up a Samba share on Ubuntu Linux.

Install the package

sudo apt-get install samba smbfs
Edit smb.conf
Open the samba configuration file in your favourite editor, change security to user and add a username map.
sudo vi /etc/samba/smb.conf
# "security = user" is always a good idea. This will require a Unix account # in this server for every user accessing the server. See # /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html # in the samba-doc package for details. security = user username map = /etc/samba/smbusers
Create a samba user
sudo smbpasswd -a fahd
Add the new user to the smbusers file
The format is "unix username" = "samba username".
sudo vi /etc/samba/smbusers
fahd = fahd
Share home directory
Make the following changes to smb.conf in order to share your home directory over samba and make it writable.
sudo vi /etc/samba/smb.conf
#======================= Share Definitions ======================= # Un-comment the following (and tweak the other settings below to suit) # to enable the default home directory shares. This will share each # user's home directory as \\server\username [homes] comment = Home Directories browseable = no # By default, the home directories are exported read-only. Change the # next parameter to 'no' if you want to be able to write to them. read only = no # By default, \\server\username shares can be connected to by anyone # with access to the samba server. Un-comment the following parameter # to make sure that only "username" can connect to \\server\username # This might need tweaking when using external authentication schemes valid users = %S
Connecting to the samba
Now you should be able to map a drive on windows using the following share format: \\ubuntumachine\username. The first time you will be prompted for a username and password.

Restarting samba

sudo /etc/init.d/samba restart