File sharing between Haiku and host OS

File sharing between Haiku and host OS

  • mdo  DigitalBox
  •   Tips
  •   November 6, 2024

If you are using Haiku under virtualization, sometimes it can be necessary to exchange files between the Haiku as guest OS and your host OS.

There's any easy way to do, I will explain in this article.

In addition to Haiku installed on a bare bone machine - a NUC Intel - I'm also using Haiku under virtualization to make some tests from scratch or to write articles for this blog.

When it comes to exchange files between Haiku and your host OS, it can be tricky depending on the virtualization tool your are using (QEmu, Virtual Box) and the host OS (MacOS, Windows, Linux).

Default setup

Maybe you are not aware of this, but by default, an SSH server is running on Haiku :

If you check in a Terminal with "sshd", you will see the below process :

pidof sshd

In order to be able to use SSH with Haiku, you need to set the default password.

For that, type in a Terminal :

passwd

Define the password to be used for the Haiku user, and type again the password to validate.

As you can see below, the user name under Haiku is simply "user" :)

Then edit the  "/system/settings/ssh/sshd_config" file :

lpe /system/settings/ssh/sshd_config &

In the Authentication section put the line below :

PermitRootLogin yes

Save the file.

Restart your system to have sshd using these new settings.

Now, let's check if the SSHD server is recognized from your host OS.

On my MacBook Pro, I've launched a Terminal window and try to connect with user "user" on the local address IP "192.168.64.12" which is visible in the Network preferences in Haiku :

ssh user@192.168.64.12

Entering the password and validating make the connection effective under Haiku confirmed by the below message:

You can quit your SSH session, by typing "exit" in the shell. We're now good to go !

From Haiku to host

Imagine you would like to retrieve the logo picture from your Haiku OS to your host OS.

The picture is available via the full pathname "/boot/system/data/artwork/HAIKU logo - white on blue - big.png" :

The magic command to make the transfer is named "scp" (Secured Copy Protocol).

It's doing a SSH copy from a source file to a destination : in our case, we will copy the Haiku PNG logo to the current host OS directory (current directory is symbolized by the "." character).

For that, type the below command in a Terminal on your host OS :

scp user@192.168.64.12:"/boot/system/data/artwork/HAIKU logo - white on blue - big.png" .

If you check the current directory on your OS, the transfer has been completed :

Yes, the nice Haiku logo is now available on your host OS :)

From host to Haiku

Now, imagine you would like to transfer an image from your host OS into Haiku, how to do so ?

The answer is quite simple : let's use "scp" again !

Suppose, we would like to transfer the below MacOS logo into Haiku "boot/home" directory :

The command to transfer this PNG file is :

scp /Users/nicolas/Desktop/Documents/MacOS_logo.png user@192.168.64.12:/boot/home

If you return to Haiku, you will see the below image transferred :

Tada !

You are now mastering the art of transfering files from or into Haiku :)


Powered by Bludit - Hosted by Planet Hoster
© 2025 Haiku Insider