VSCode over SSH can't install on boot drive

Hello,

Today I tried to get VSCode installed but there are a few things preventing me to do this.

It seems in Fangtooth this vulnerability has already been patched:

The boot pool is now properly enforcing the default setuid and noexec options (NAS-127825). This restores the default boot pool behavior to be restricted from general use. Users that are currently attempting to exec scripts from a /home or other boot pool location should move these to a data pool location.

I am using ssh keys to connect and everything seems to work, I select which system, it asks me for a passphrase and after that I “should” connect. However I get these errors:

kill: No such processsh: 401: /home/truenas_admin/.vscode-server/code-blabla: Permission denied

It means that it is working as intended. I also tried turning on TCP forwarding on SSH service in TN without success.

Here is my problem. Do I move the user to a dataset on another pool?
I would have to move the user from boot-pool to my other pool which is not so straight forward if I look at the UI:

Does anyone have some pointers for me?

Yes. You should not put anything on the boot pool but the TrueNAS installation. That includes users’ home directories.

That’s great, Truenas won’t let me move these directories through the UI though. Any idea’s?

Is there any reason why you must put things in the home directories specifically in the first place?

Because that’s what VSCode does when you use it this way, which is an extremely convenient way to use it: it connects to the server in question, installs an agent in the specified user’s home directory, and uses that to do the rest of its thing.

It appears TrueNAS doesn’t allow you to change the home directory for the admin (or now, for some reason, truenas_admin) user. Of course, there’s no reason you couldn’t set up another admin user and set that user’s home directory to be somewhere other than /home.

Create a users dataset on a data pool.

Then create a new non-admin user for vscode use with a home directory as a sub-directory of users.

Would a symlink work?

Not at all, it just do it automatically. It seems I cant change home directory for that user though, even if i am admin.

Thanks for the suggestions, I decided to remake my admin user and point a dataset as its home folder.

For others:

Made new dataset:

Made a new user which is almost a 1 on 1 copy of the truenas_admin I used:


I also made sure that I pointed my home directory to the new pool.

I recreated the connection in VSCode with the new user but I used the same SSH keys in the config. I also added the public key to the user account in Truenas and voila:
image

1 Like