Thunar: Failed to open "smb://<address>": The specified location is not supported - raspberry-pi

I am trying to setup a NAS server on my raspberry pi which can be accessed by my home linux machine running Arch.
This is my config from /etc/samba/smb.conf on my raspberry pi
[Cloud Pi]
comment = Pi shared folder
path = /home/pi/Shared
browseable = yes
writeable = yes
public = yes
only guest = no
force user = root
force group = root
guest ok = yes
create mask = 0777
directory mask = 0777
read only = no
Ran the following command on my home linux machine to load the smb server
thunar smb://<IP address>
And was greeted with
Thunar: Failed to open "smb://<IP address>": The specified location is not supported

Turns out there were two things I was doing wrong.
No config file in home linux machine
I had downloaded the samba package from AUR. On further reading in their official homepage, they say that post-installation, we need to manually create a default config file at /etc/samba/smb.conf.
I copied the contents from here and pasted it in a new manually created /etc/samba/smb.conf file.
Missing dependencies for Thunar
The following packages were necessary to make it work in my case.
thunar-shares-plugin
gvfs-smb
After installing the dependencies, the first time I tried to open a file I had to login using my username & password I had used in my raspberry pi while setting up the samba server.
Since then, it works as expected.

Related

Raspberry Pi SSH Access Denied

I am trying to log into my Raspberry Pi using PuTTY from Windows. However, whenever I try to log into my Raspberry Pi using the default username and password (pi* and raspberry) it says Access Denied.
I have the wpa_supplicant.conf file and ssh file created. This is its first bootup. I am using the latest version of the Raspbian Lite OS.
Recently, the default user setup of Raspbian was significantly changed, rendering most existing online tutorials invalid.
In essence, the default pi user no longer exists, so you have to create it and set its password using either the official Imager tool or by creating a userconf file in the boot partition of your microSD card, which should contain a single line of text: username:hashed-password, replacing username with the name of the user you want (e.g., pi) and hashed-password with the hash of the password you want.
According to the official guide, the easiest way to do this is by running the following in a terminal (Linux or macOS):
echo 'password' | openssl passwd -6 -stdin
Again, you should replace password with the password you want here.
Further reading: An update to Raspberry Pi OS Bullseye (2022-04-07)
The default username and password are no longer valid for Raspberry Pi.
If you are trying to log in headlessly (without a monitor and keyboard), you can do it from Raspberry Pi Imager itself.
On selecting the OS in Raspberry Pi Imager, you get an icon of settings in which you can
create a user
setup Wi-Fi
enable SSH
After configuring, you can continue flashing your memory card.
And on first boot you will be good to go.
I have solved this problem. You can easily input your username and password with Raspberry Pi Imager.
add the user you created when flashing the image to the ssh group.
usermod -a -G ssh YourPiUsername

using a conda virtual environment in jupyter notebook

I have read and implemented instructions from earlier posts like:
How to start an ipython shell(not notebook) within a conda or virtualenv
My goal is to use a kernel in ipython which has all conda packages from my virtual environment.
I have a google ubuntu 16.04 machine where I have installed anaconda and a virtual environment in which i installed all my packages..
when i run
python -m ipykernel.kernelspec
i get the following error:
/home/admin/anaconda3/envs/py36ve/lib/python3.6/site-packages/IPython/paths.py:61: UserWarning: IPython dir
'/home/admin/.ipython' is not a writable location, using a temp
directory.
" using a temp directory.".format(ipdir))
[Errno 13] Permission denied: '/usr/local/share/jupyter/kernels/python3'
I tried running with sudo too.. i created a kernel but when i use it then it has none of the packages i installed in the virtual environment..
I do have a similar issue with this when I try to submit my program to a cluster where it doesn't have access to my local directory and it shows the same message. But I don't get Permission denied message and everything is fine by me. But I wanted to address this issue and looked into it and I found that paths.py at line 62 in python package in the case of not writable, it creates a temp directory like the following:
ipdir = tempfile.mkdtemp()
As in tempfile documentation says:
Creates a temporary directory in the most secure manner possible. There are no race conditions in the directory’s creation. The directory is readable, writable, and searchable only by the creating user ID.
It is strange that you do get this but if you want to make it work, find the paths.py and change that to your liking and makes sure it works and replace it with the original.

Autostart deluge daemon 1.3.10 on boot on Raspberry Pi

I have already been through different tutorials on how to set raspberry pi into a torrent box, but I think most of the how-to tutorials are out-dated.
I have also check my version of deluge daemon using his command:
deluge -v
And it returns this:
deluged: 1.3.10
libtorrent: 0.16.18.0
I have followed the How-To Geek tutorial so far.
Link: http://www.howtogeek.com/142044/how-to-turn-a-raspberry-pi-into-an-always-on-bittorrent-box/
After I stared to get errors I have fully uninstalled and deleted all the files of deluge.
The tutorial suggests this command:
sudo wget -O /etc/default/deluge-daemon http://cdn5.howtogeek.com/wp-content/uploads/gg/up/sshot5151a8c86fb85.txt
But there is no such file as /etc/default/deluge-daemon, instead there is a deluged named file (maybe short for deluge-daemon in new version)
Basically what the command does is that it copies the content of the file http://cdn5.howtogeek.com/wp-content/uploads/gg/up/sshot5151a8c86fb85.txt to the file located at /etc/default/deluge-daemon.
As I can't find deluged-daemon, I chose to do this with /etc/default/deluged
The original content of /etc/default/deluged:
# Defaults for deluged initscript
# sourced by /etc/init.d/deluged
# change to 1 to enable daemon
ENABLE_DELUGED=0
Content provided on the file http://cdn5.howtogeek.com/wp-content/uploads/gg/up/sshot5151a8c86fb85.txt:
# Configuration for /etc/init.d/deluge-daemon
# The init.d script will only run if this variable non-empty.
DELUGED_USER="pi" # !!!CHANGE THIS!!!!
# Should we run at startup?
RUN_AT_STARTUP="YES"
But both files looks different and the deluge daemon doesn't load up on startup.
I managed to resolve this issue using this guide: http://dev.deluge-torrent.org/wiki/UserGuide/Service/systemd.
Follow instructions from this guide (you may skip deluge-web instructions).
Note that deluge user was created with --home /var/lib/deluge.
Update auth (setup an account) and core.conf (set allow_remote flag) files in home dir of deluge user (as opposed to home dir of pi user that is usually mentioned in other tutorials).
Reboot

Can I add (create) shared directories from the host to a running Vagrant box on the fly?

I have a situation where I would like to add shared folders to a running Vagrant box (Ubuntu guest) provided by VirtualBox.
According to the docs, these "Synced Folders" should be defined in the configuration file like so:
config.vm.synced_folder "/mnt/plugdrive15", "/synced/plugdrive15"
But what if I need to share directories that are new on my host? I have this often and I cannot predict their names, so I cannot pre-write them beforehand in the configuration file. I want to automate this.
Using VBoxManage sharedfolder add doesn't work, because as soon as you do vagrant up, only the shares specified in the configuration file (and the default vagrant one) are left.
If all else fails (no better solutions), can Vagrantfile parse a configuration file (in which I specify shares right before vagrant up?
You can using virtual box interface, you have a shared folder option in the VM setting and you can add a new folder while the VM is running
[edit]
there is ofc a command line tool associated : http://www.virtualbox.org/manual/ch04.html#sharedfolders
[edit 2]
Setting the vm name is a provider specific operation, so VBoxManage tool will consider it as well.
config.vm.provider :virtualbox do |vb|
vb.name = "barhost"
end
If you don't specify a name vagrant will generated one, see How to change Vagrant 'default' machine name? for precisions.

I can ping my centOS virtual machine but I cant access its shared folders

so this is the setup:
I have a Windows XP installed, VirtualBox and a centOS 6.2 virtual machine.
I installed Samba, and currently, my VM and host Windows are in the same subnet.
I can ping my VM from Windows and vice versa.
I have a created a shared folder via Samba like this:
[Share]
path = /home/share
writable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777
share modes = yes
*I followed a full tutorial here
My problem now is that, when I try to access such folder like this \192.xx.xxx.xxx\home\share (192.xx.xxx.xxx is the IP address of my VM) from Windows "Run",
Windows can't find it.
P.S. I've turned off my Windows Firewall (although Trend Micro personal firewall is still on)
found the solution, I changed the iptables, and smb.conf to allow my Host IP address to access my guest. Thanks anyway :)