Cannot Launch VS Code from Terminal

What is the problem you are having with rclone?

When attempting to launch VS Code from the terminal using "code .", the command fails with the error "cannot open path of the current working directory: permission denied"

The folder can be opened without issues from within VS Code, after launcing with "code" (no . for the current working directory. 

The working directory in a mount point to onedrive remote.

startup mount command:

sh -c "rclone mount \myonedrive\: ~/OneDrive" --vfs-cache-mode full --vfs-cache-max-size 50GB 

The remote is working fine otherwise. Can navigate via terminal or GUI, can edit, cut, copy, past files etc. 

My suspicion that the "." is not being expanded in "code ." though "ls ." works fine. 

Run the command 'rclone version' and share the full output of the command.

rclone v1.61.1

- os/version: ubuntu 22.04 (64 bit)

- os/kernel: 6.1.11-surface (x86_64)

- os/type: linux

- os/arch: amd64

- go/version: go1.19.4

- go/linking: static

- go/tags: none

Yes, installed today using instruction at rclone.org

Which cloud storage system are you using? (eg Google Drive)

OneDrive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

code .

The rclone config contents with secrets removed.

[myonedrive]
type = onedrive
token = {"access_token": ---deleted---}
drive_id = b593cb2df5814c3d
drive_type = personal

A log from the command with the -vv flag

Feb 17 19:49:04 ****-Surface-Book systemd[1480]: Started VTE child process 7440 launched by gnome-terminal-server process 3189.
Feb 17 19:49:42 ****-Surface-Book systemd[1480]: Started snap.code.code.78869f4c-0863-4699-b29f-07c4f714e18e.scope.

hello and welcome to the forum,

just curious, does this work?
code $PWD

No. It generates the same error.

can you do the following?
--- add -vv to the mount command, for debug output
--- start the mount.
--- code .
--- kill the mount
--- post thefull debug log.

Not sure what you mean by "kill the mount".

Is there an rclone option to do this? Or do you mean to kill the rclone process?

yes, that is what i meant

Running this revealed a syntax error on my cache-max-size, which I've corrected (removed the B in 50GB)
The error near the end may be because I was still in the mounted folder in the terminal where I ran "code ."

userid@userid-deviceid:~$ rclone mount \myonedrive: ~/OneDrive --vfs-cache-mode full --vfs-cache-max-size 50G -vv
2023/02/18 11:05:37 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rclone" "mount" "myonedrive:" "/home/userid/OneDrive" "--vfs-cache-mode" "full" "--vfs-cache-max-size" "50G" "-vv"]
2023/02/18 11:05:37 DEBUG : Creating backend with remote "myonedrive:"
2023/02/18 11:05:37 DEBUG : Using config file from "/home/userid/.config/rclone/rclone.conf"
2023/02/18 11:05:39 DEBUG : OneDrive root '': Next delta token is:token deleted
2023/02/18 11:05:39 DEBUG : vfs cache: root is "/home/userid/.cache/rclone"
2023/02/18 11:05:39 DEBUG : vfs cache: data root is "/home/userid/.cache/rclone/vfs/myonedrive"
2023/02/18 11:05:39 DEBUG : vfs cache: metadata root is "/home/userid/.cache/rclone/vfsMeta/myonedrive"
2023/02/18 11:05:39 DEBUG : Creating backend with remote "/home/userid/.cache/rclone/vfs/myonedrive/"
2023/02/18 11:05:39 DEBUG : fs cache: renaming cache item "/home/userid/.cache/rclone/vfs/myonedrive/" to be canonical "/home/userid/.cache/rclone/vfs/myonedrive"
2023/02/18 11:05:39 DEBUG : Creating backend with remote "/home/userid/.cache/rclone/vfsMeta/myonedrive/"
2023/02/18 11:05:39 DEBUG : fs cache: renaming cache item "/home/userid/.cache/rclone/vfsMeta/myonedrive/" to be canonical "/home/userid/.cache/rclone/vfsMeta/myonedrive"
2023/02/18 11:05:39 DEBUG : OneDrive root '': Mounting on "/home/userid/OneDrive"
2023/02/18 11:05:39 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2023/02/18 11:05:39 DEBUG : : Root:
2023/02/18 11:05:39 DEBUG : : >Root: node=/, err=
2023/02/18 11:05:39 DEBUG : /: Lookup: name=".Trash"
2023/02/18 11:05:40 DEBUG : /: >Lookup: node=, err=no such file or directory
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: Lookup: name=".xdg-volume-info"
2023/02/18 11:05:40 DEBUG : /: >Lookup: node=, err=no such file or directory
2023/02/18 11:05:40 DEBUG : /: Lookup: name="autorun.inf"
2023/02/18 11:05:40 DEBUG : /: >Lookup: node=, err=no such file or directory
2023/02/18 11:05:40 DEBUG : /: Lookup: name=".Trash-1000"
2023/02/18 11:05:40 DEBUG : /: >Lookup: node=, err=no such file or directory
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Attr:
2023/02/18 11:05:40 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:05:40 DEBUG : /: ReadDirAll:
2023/02/18 11:05:40 DEBUG : /: >ReadDirAll: item=168, err=
2023/02/18 11:05:40 DEBUG : /: Lookup: name="autorun.inf"
2023/02/18 11:05:40 DEBUG : /: >Lookup: node=, err=no such file or directory
2023/02/18 11:06:39 DEBUG : OneDrive root '': Checking for changes on remote
2023/02/18 11:06:39 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2023/02/18 11:07:39 DEBUG : OneDrive root '': Checking for changes on remote
2023/02/18 11:07:39 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2023/02/18 11:08:02 DEBUG : /: Attr:
2023/02/18 11:08:02 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
2023/02/18 11:08:06 DEBUG : /: Attr:
2023/02/18 11:08:06 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxr-x, err=
^C2023/02/18 11:08:29 INFO : Signal received: interrupt
2023/02/18 11:08:29 DEBUG : vfs cache: cleaner exiting
2023/02/18 11:08:29 ERROR : /home/userid/OneDrive: Failed to unmount: exit status 1: fusermount: failed to unmount /home/userid/OneDrive: Device or resource busy
2023/02/18 11:08:29 INFO : Exiting...

If it isn't obvious, I'm new to linux.

What I'm trying to accomplish is a consistent workflow across multiple platforms; MacOS, Windows 11, WSL2, Linux using OneDrive as a shared folder for code.

not sure the best way to get that done in your case.
i run vscode on windows and then have vscode, using ssh, to remote install vscode onto other machines running linux.

when i run vscode . from wsl2, it starts the windows version.

why use onedrive instead of git or github.com?

maybe @ole has an idea?

To directly answer your question - I just haven't learned to use git / github yet.

I don't disagree that OneDrive may not be the best common storage medium for code files. But it works (really well on Windows and Mac, pretty well on WSL2, and sort of on Linux), and I have an enormous amount of space there. Maybe I'll move my workflow over to git / github at some point, but at this stage I'm not prepared to do that.

It's not the end of the world that this doesn't work, but it seems like it should.

Thanks for the effort.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.