-2

I have installed WSL (Windows Subsystem for Linux) and it works perfectly. I like opening bash with CMD or PowerShell typing "bash" because it keeps the same folder.

For example:

PS C:\Users> bash
root@X /mnt/c/Users #

I also use Google Drive (backup and sync).

The folder is in C:/Users/X/Google Drive.

The problem is that when I use "my trick" in that folder it doesn't work. It leads me to bash ~ instead of the real location.

Firstly I thought that It was caused by the spaces from "Google \Drive" but no. All folder work fine (even with spaces)

To sum up, I can't start in that folder or under it. However I can cd there, but you know... not convenient.

Sorry my english in advance, and thank you for your answers :)

  • 2
    This Q is not about programming as defined for StackOverflow. It *may* be more appropriate on https://superuser.com or another StackExchange site. Use the `flag` link at the bottom of your Q and ask the moderator to move it. Please don't post the same Q on 2 different sites. ***Please*** read https://stackoverflow.com/help/on-topic , https://stackoverflow.com/help/how-to-ask , https://stackoverflow.com/help/dont-ask and https://stackoverflow.com/help/mcve before posting more Qs here. Good luck. – shellter Nov 04 '17 at 22:40
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Nov 04 '17 at 23:53

2 Answers2

0

I'm a little confused about your question but will do my best to be helpful. It seems that you are attempting to run bash in a Windows environment? I know little of Windows, but work and play in Unix daily.

Once you're using your terminal like a unix terminal, Bash WILL struggle with Google Drive. I use GD as well, and the whitespace is the bane of my existance. However, for simple command-line navigation, something like "cd ~/Google\ Drive" will change your directory to the GD dir. This can be applied to other scenarios as well.. variably.

If you are trying to go to the location in the code you posted, in bash, this would be the appropriate syntax:

cd /mnt/c/Users

This may not apply to Windows, but on a Unix machine, you can get to your personal user directory in appbreviated fashion using "~":

 cd ~/

Hope this helps.

SSS
  • 42
  • 4
0

work-around: https://github.com/Microsoft/WSL/issues/2999#issuecomment-455835951 Here is a way to mount GFS in WSL based on https://superuser.com/questions/1353169/getting-sshfs-working-on-wsl-or-finding-an-alternative The trick is to use https://www.nsoftware.com/sftp/netdrive/ to ssh to GFS from Windows and relay it as a filesystem that can be mounted under WSL.

  1. Install OpenSSH Server under Win10

    • Win10 Settings -> Apps -> Manage optional features -> Add feature -> OpenSSH Server
  2. restart if necessary

  3. open Services -> OpenSSH -> Properties -> Startup Type -> Automatic (delayed)

  4. Install and run SFTPNetDrive, right click on icon in hidden icons -> Main window (or maybe already open) -> Profile -> new profile ( server: localhost, user: * pwd:* Drive Letter: F (or another) Advanced -> ( Protocol -> uncheck compression; Specified folder: G:\ ) )

  5. in Bash (wsl): sudo mkdir /mnt/f; sudo mount -t drvfs F: /mnt/f

I'm not sure how stable it is, but I was able to open files in WSL.