Search code examples
virtual-machinevirtualboxwindows-subsystem-for-linuxubuntu-20.04

How to change ubuntu version to earlier one on wsl?


everyone! I'm a new learner and I need your help! Lately, I installed wsl on my Windows for my tasks, it's the latest version of Ubuntu on it - 22.04. But at this moment I need to write bash scripts on Ubuntu 20.04 version, there are differences on how scripts run on different Ubuntu versions.

I see 2 ways of solving this problem. Or to change the version of ubuntu on wsl, or to connect to virtual box machine.

  1. So, how do I return to an earlier version on wsl, if it is possible?
  2. Or how do I enter from my wsl terminal to my ubuntu 20.04 in virtual machine (on Virtual Box)? Or maybe there is another solution, that I don't know.

Thank you in advance for your answers!)


Solution

  • I want to write what I did to solve my problem. After searching and reading about different ways to solve my problem, taking into account all the given advices here, I got to conclusion that the easiest way for me, to create a common folder on my host OS (aka Windows), which will be seen also from my virtual machine. This way I write, edit my tasks in that folder, then run and test both through wsl (which has ubuntu 22.04 on it) and through VM (with ubuntu 20.04 on it). So, at the same time I can learn of there are any differences between these Ubuntu versions. Maybe this will be helpful to someone!