4

Can Ubuntu Bash installed from Windows Store destroy or change Windows files?

I want to use Ubuntu Bash freely and not be afraid if I break something. I want to know if Ubuntu Bash has the permissions to make Windows unable to use.

rchard2scout
  • 117
  • 5
yierstem
  • 199
  • 3
  • 9
  • Yes, WSL has access files within Windows. Of course you have to specifically mount those locations. – Ramhound May 17 '18 at 12:07

3 Answers3

8

The short answer is Yes, it can modify files on your computer, but for a Windows OS file you need admin permissions to modify it. So, No it can't modify Windows OS files

If you want an isolated environment to try out/experiment with bash (or maybe Linux Command-line in general, also referred to as GNU Userland) then a better idea would be to setup a VM(Virtual Machine),but don't expect to use VM for development/deployment/etc purposes. Commonly used VM software are VMware and VirtualBox. You may need to enable Hardware Virtualization in your BIOS though for running amd64/86_64x/64-bit images of any Linux Distribution (such as Debian, RHEL, Fedora, Ubuntu, Mint, CentOS, etc) otherwise you'll be restricted to IA-32/x86/32-bit images of Linux Distributions.

Use a Native Linux installation for actual development/deployment/etc (or WSL, it's bare though and you can't run everything on it), assuming you are developing/deploying/etc for a Linux System.

Another option is using Live Boot. It'll provide you with a Guest session through a bootable USB or DVD burned with a Linux Distribution image for your PC. The problem with this method is it doesn't save any data (user settings, software installation, files, etc) on either the bootable media or mount your HDD on it's own. You can mount & modify the files (including windows) but only if you meant to do so, since due to hiberfile you won't be able to write/modify to the HDD only read/open files. Thst can be remedied using ntfs-3g to remove the hiberfile. Another way to save files (but not settings) is to create a partition within the bootable USB (not a DVD for this purpose), with one partition having the bootable OS image while the other formatted with a filesystem like a normal USB. You'll have to mount the partition (or it maybe auto mounted based on defaults of the particular Linux Distribution)

Nick S
  • 105
  • 5
ToxicMender
  • 208
  • 1
  • 5
  • So, how can I restrict it to prevent any possible damage? – yierstem May 17 '18 at 12:21
  • 1
    Check these links for more regarding WSL: https://github.com/MicrosoftDocs/WSL https://docs.microsoft.com/windows/wsl – ToxicMender May 17 '18 at 12:38
  • 1
    Normally the WSL creates your `home` directory in `%USERPROFILE%/AppData` or somewhere deeper (not sure about the exact location), so you'll generally be restricted to the inside of that directory (& other folders outside it that have to do with the Linux FS). Although you can mount your HDD as `/mnt/c` (for C:\) but it's not mounted by default. – ToxicMender May 17 '18 at 12:39
  • 1
    What's wrong with using a VM for development/deployment, especially development? – multithr3at3d May 17 '18 at 13:06
  • @multithr3at3d generally VM deployed on a PC utilizes a lot more resources than would be normally required for just about anything you do on it. Also It's doesn't seem like he was talking about a server running windows server so no for deployment as well. – ToxicMender May 17 '18 at 13:28
  • 1
    @TrippKinetics Cygwin is something quite different, although agreed it would offer the advantages of bash and quite a lot of the GNU utilities, etc but unlike WSL or VM you can't install native applications for Linux. Although I haven't used Cygwin myself so don't know much about it honestly. – ToxicMender May 17 '18 at 13:35
6

As stated, the answer is Yes, but you have options related to the second part of your question.

Depending on what you want to do, you can also setup a Docker container to use bash freely and not be afraid of breaking things. In my experience it would be about as easy as setting up a VM. There are plenty of tutorials around.

https://docs.docker.com/docker-for-windows/install/

https://odewahn.github.io/docker-jumpstart/containers.html

These are a couple of tutorials to get you started.

Mulli
  • 111
  • 4
1

Yes, you can access and manipulate files on Windows Filesystem. It is really helpful, you can also run windows programs through bash shell. Super usable for your productivity if you are comfortable with Linux terminal, but still like to use Windows.

Kristjan
  • 121
  • 3