[SOLVED] Getting access to the configuration files on OH2 from Visual Studio

As I am starting to work through the configuration files for OH2, items, sitemap, rules etc. I’m finding the nano file editor is becoming a great pain to use. I have since d/l’ed the Video Studio editor and tried using it to manage those files. I can read the files and edit them, but when I try to save them back to OH2, I get the error message that says I don’t have access to be able to save them. Is there a setting in OH2 to change that?

I found your problem, you need the vi editor… lol!

All kidding aside, I definitely prefer the vi editor over nano so I understand your nano frustration.

On your visual studio code, you need to execute “sudo chmod -r 777 /etc/openhab2/*” or when you mount your directory try mounting as the Linux user. Either of these should hopefully fix the permission issue/.

Please read up on possible security issue having the files at 777. But in my opinion there is not a real issue as long as your samba share asks for a password.


I have been reading so much in the last 4 days about this system I’m going cross-eyed.
I get one thing fixed and then another pops up. The POS editor doesn’t help either.

But I did manage to get 3 door switches working and renamed everything to match our home layout.

I am so used to a mousey interface, it feels like I’m back in DOS 3.2 !!

This is the first time I have ever worked with a pi and all this networking stuff is new to me so please be gentle.


1 Like

When using a Raspberry Pi, (especially when using it for the first time…) it’s recommended to setup openHAB via openHABian, which will install the most recent Raspbian as well as the most recent stable openHAB2 Version.
Furthermore, it will configure samba to share some folders.

From Windows (or Mac…) use the share as any other windows share. Be aware that the user has to be openhab to grant write access.

As Editor, I highly recommend VSCode (VisualStudioCode) which is not Visual Studio nor Visual Studio Editor, it’s in fact a completely independent software.
Within VSCode, you can install plugins (no need to download them separately, there is a plugin browser in VSCode), one of them is the openHAB plugin which will enable VSCode to highlight, mark errors, autocomplete, list things and items (with actual state)…
You can get VSCode for Windows, Mac and Linux as well, it’s Open Source under MIT licence.

Thanks Udo. I just did what I have done 10 times now. Format the sd card and start over but saving all my work to a thumb drive. Now everything works as described even the VSCode, sorry for the mistake there. This stuff is all new but with every rebuild I learn something new. Soon I should be able to stop having to do that and move forward! VSCode is wonderful !!

I am currently following BK Hobby’s video series and learning a lot.

Thank you