Tiny Core Linux

General TC => Tiny Core on Virtual Machines => Topic started by: alphons on November 29, 2021, 03:22:56 AM

Title: TinyCore on Windows Subsystem for Linux (WSL)
Post by: alphons on November 29, 2021, 03:22:56 AM
Here are some preliminary results of my attempt to get TinyCore running on Windows Subsystem for Linux (WSL)

This can be an alternative to the other Virtual-Machine options.

For more information on this technique https://docs.microsoft.com/en-us/windows/wsl/ (https://docs.microsoft.com/en-us/windows/wsl/)

What I did, was making a tar file from a running (live) TinyCore system, including installed tce extensions by running this command:

Code: [Select]
$ sudo su
# cd /
# tar -cvpf tinycore.tar --exclude=tinycore.tar --exclude=proc --exclude=dev --exclude=sys /

This file is needed to 'install' it on the WSL system.

First have the Windows WSL system up and running, this is a trickey part because there are so many Windows distributions out there, after some experiments this was my summary of actions:

Search for PowerShell, richt click and run as Administrator and execute these 2 commands:

Code: [Select]
> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
> Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

After this, you have to reboot your windows system.

In the process of importing the tar file (later on) i got an error 'FATAL: kernel to old'
I did some of these things (not sure which solved it) and the error went away:

Download the 'kernel' update package from
https://docs.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package (https://docs.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package)

Execute on windows:

Code: [Select]
wsl_update_x64.msi
In PowerShell execute:

Code: [Select]
> wsl --set-default-version 2

If all goes well, it is time to 'import' our tar file into the WSL system.
Choose your destination directory, for me it was c:\temp\TinyCore
Execute this command in PowerShell:

Code: [Select]
> wsl --import TinyCore c:\temp\TinyCore .\tinycore.tar
Make sure to use the new WSL kernel on our TinyCore distribution.
Execute this command in PowerShell:

Code: [Select]
> wsl --set-version TinyCore 2
(takes some minutes....)

Time to 'boot' your TinyCore system, execute in PowerShell:

Code: [Select]
> wsl -d TinyCore
For the result see the attachement. All works, including tce-load etc.
The backup / restore features of TinyCore are a bit crippled,
and my 'sda1' user disk is turned into a directory.
So keep in mind it has some caveats.









Title: Re: TinyCore on Windows Subsystem for Linux (WSL)
Post by: mocore on February 02, 2022, 05:38:06 AM
For more information on this technique https://docs.microsoft.com/en-us/windows/wsl/ (https://docs.microsoft.com/en-us/windows/wsl/)

iv not read this link ...but was reminded of this topic while reading https://github.com/giuliano108/guix-packages/blob/master/notes/Guix-on-WSL2.md this overview of the "Subsystem for Linux "
ftr via
https://gist.github.com/giuliano108/49ec5bd0a9339db98535bc793ceb5ab4

Quote from: gh/giuliano108/guix-packages/.../notes/Guix-on-WSL2.md
WSL2 distros are, in fact, more like OS containers:

    A single instance of the Microsoft-shipped Linux Kernel is running at any given time (under Hyper-V).
    Running, from a command prompt, wsl -d distroname instructs the Kernel to create one such container, the root filesystem coming an ext4.vhdx disk image.
    The Kernel executes an /init binary which, again, is supplied by Microsoft and cannot be changed/customized. Together with the Kernel itself, init can be found in %systemroot%\System32\lxss\tools.
    /init executes a shell or the command supplied to wsl.exe
    /init also takes care of mounting all the file systems, setting up /dev, ...
    A very useful side-effect of the "single Kernel for all distros" thing is that if, say, you've got a working Ubuntu WSL distro, and a Guix WSL distro that doesn't boot, you can run dmesg under Ubuntu and see what's wrong with Guix. The Kernel is shared, the Kernel ring buffer is also shared.

  :-\
Title: Re: TinyCore on Windows Subsystem for Linux (WSL)
Post by: gadget42 on January 01, 2023, 04:28:25 AM
stumbled across an omgubuntu piece that seems to fit the size and shape of this thread

https://www.omgubuntu.co.uk/how-to-install-wsl2-on-windows-10

wonder how Lennart Poettering figures in on all this?
https://forum.tinycorelinux.net/index.php/topic,17247.msg166685.html#msg166685

also reminded of Eric S. Raymond's commentary
https://www.zdnet.com/article/open-sources-eric-raymond-windows-10-will-soon-be-just-an-emulation-layer-on-linux-kernel/
Title: Re: TinyCore on Windows Subsystem for Linux (WSL)
Post by: _matthew_ on March 15, 2025, 05:40:57 AM
I had immediate success installing tc 15, the x86 64 bit core pure flavor, and once I had it installed, it was easy to tar it up and Windows was happy to import it and to boot the image.  Thank you for the tip, I can verify it works.  If anybody else wants to skip the whole install and tar up a running system thing, drop me a note and I can hook you up with the windows bootable tar file.
Title: Re: TinyCore on Windows Subsystem for Linux (WSL)
Post by: nick65go on March 15, 2025, 10:01:00 AM
see also: https://forum.tinycorelinux.net/index.php/topic,27277.msg175495.html#msg175495
IF you missed the IMPORTANT tips:

1. You can "manualy install" ANY linux you want!

2: you do NOT need a kernel (neither its modules for sound, video, network etc), windows provides one for you! You just need a root structure, as in chroot.

3: You do NOT need a Xorg server. windows provides one for you, with hardware acceleration! basicaly you run a linux under a hypervisor (like qemu, virtualbox, vmware) but with multhreading.

FYI: a NEW kernel version foe WSL2 was just released few day ago and you can now use real external USB from VM.
PS C:\> wsl -v
WSL version: 2.5.1.0
Kernel version: 6.6.75.1-1
WSLg version: 1.0.66
MSRDC version: 1.2.5716
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.22631.5039