Arduino Portable on Windows and linux simultaneously

Hi

I have Linux installed on my External Hard drive where i also have another regular NTFS partition.

I always run arduino from the NTFS partition in portable mode on windows which stores the sketches and libraries.

But i also want same sketches and libraries on the Linux portable version as well.

I will be running only one OS at a time like Windows or Linux but want the sketches and libraries in both instances.

Is it possible if yes how???

Thanks to Microsoft it will not read the Linux files but Linux will read the windows files:-) The simplest thing is to create a directory in windows for your data. You can then read it with either windows or linux hence only one copy. I believe this will solve your problem.

I believe this is my solution but failed to understand the procedure and

yes the sketches and libraries in portable folder are in Windows folder

Could you please elaborate??

The libraries and sketches are stored in the sketchbook folder (libraries are installed under the libraries subfolder). You can set a custom sketchbook folder by doing this:

  1. Select File > Preferences... from the Arduino IDE menus.
    A "Preferences" dialog will open.
  2. Click the Browse button to the right of the "Sketchbook location" field.
    A "Select new sketchbook location" dialog will open.
  3. Select the folder you want to use as your sketchbook.
  4. Click the Choose button on the "Select new sketchbook location" dialog.
  5. Click the OK button on the "Preferences" dialog.

If you make sure both IDE installations use the same sketchbook folder, you are set.

I guess this would not be suitable for my application as i would not be fixing a static folder location as the drive letter of portable drive would change.

You can try creating a symlink that points the portable/sketchbook subfolder of your portable IDE installation to the shared sketchbook location on the permanent drive.

Windows requires you to create symlinks as an administrator.

Ok so i will keep my windows as a main one and linux will be using a symlink.

How do i assign this portable folder to linux portable folder using symlink. Are there any guides????

You can learn about the ln command by typing this in the terminal:

man ln

Ok i have done everything like installing and symlink as well and folder is shown in installation folder but the IDE closes down on its own without startup. And the first time it ran it did not use the portable folder at all.

This is usually caused by the sketchbook folder not existing and the IDE not being able to create it.

I just gave it a try and it works fine for me, so I think you probably did something wrong. I'll share what I did.

  1. Create a folder you will use as your sketchbook. Mine is at this path:
    /home/per/Documents/test-sketchbook
    
  2. Create a folder named portable in the Arduino IDE installation folder.
  3. Open a a command line terminal in the portable folder you created.
  4. Type the following command:
    ln -s /home/per/Documents/test-sketchbook sketchbook
    
  5. Press the Enter key.
  6. Start the Arduino IDE.
  7. Select File > Preferences... from the Arduino IDE menus.
  8. In the "Sketchbook location" field, type sketchbook
  9. Click the OK button.

I figured out the problem the folder name in was

Portable

When refernced in linux it needed to have it as portable i created it using symlink and everything worked fine. But still compiling for rp2040 works in windows but not linux i get a error missing file.

Great work on finding the cause of the problem! The Windows file system is case insensitive, so Portable and portable are equivalent. The Linux file system is case sensitive, so the correct case must always be used in paths.

I see this cause problems regularly in that library developers who use Windows never notice they have used incorrect filename case in their #include directives (e.g., #include <arduino.h>), but then the library doesn't work for Linux users.

Please provide the full and exact text of the error message and I'll take a look.

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