[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Persistent sshfs mount from inside a Buster virtual machine?



nate, 

to your question. no.
i have a couple of different logins to my vms for some reason that's why i have $USER in the bottom of my first reply, so bear with me.

  what i did was to mkdir $whatever on the host machine.
and then on the vm's i made the same dir $whatever, on the vm i then put the config file "home-$USER-share.mount", (i just named it '...mount' so that i knew what it was.), into /etc/systemd/system/. .
  i then did an sshfs from vm into host from the $USER with the rsa key.  i then changed to root and ran an sshfs with the $USER@hostname, it will connect if you have your rsa keys set up right. (why i had to do this as root???)
  i then did a reboot on the vm to see if it would startup correctly and mount what i wanted it to.
  
  make sure that you change the perms on the file that you are putting into /etc/systemd/system/ "644". you might just have to have it 444, read-only, depends on the system, just checked mine and they have different perms depending on distro.
  pull up and tail journalctl -xe and take a look to see if it's starting properly.  if you do a 'systemctl status filename' (what you named the config file that you put into /etc/systemd/system/) and it will tell you if it's running or not.  if it's not running, do a 'systemctl start filename' and look at the journalctl to see what it's saying.
  you can also tail your host's /var/log/auth.log and watch that to see if you're logging in or if you are getting ejected on the host.

  biggest things that i learned from messing around with this is-
make sure the $USER is correct in the config file
make sure that the perms are correct. (i would start with 444)
make sure that you have the config file pointing to the proper id_rsa file
run sshfs as both the $USER and then root- sshfs $USER@hostname

i hope that that helped some.
em


Reply to: