# "Illegal variable name" error while I'm trying to install and configure Docker on FreeBSD



## ziomario (Jul 8, 2021)

Hello.

I'm a new FreeBSD user, I'm looking inside the FreeBSD ecosystem for the tools that usually I use in Linux. At the moment I'm trying to install and configure docker and I found this tutorial :

https://linuxhint.com/install-docker-freebsd/

and I've followed up until the end. Everything went good until the last command that gives me an error message :


```
Illegal variable name.

# docker images
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
```

He says : "Copy-paste this command to the .bashrc/.zshrc file, and you’re all set to use docker on FreeBSD"


```
eval "$(docker-machine env default)"
```

Good. In my system I haven't found any .bashrc or .zshrc file. Two files can be a good place where add the command :

1) /home/zioma/.cshrc

and

2)  /home/zioma/.xinitrc

Adding `eval "$(docker-machine env default)"` on the first one I get the following error :


```
Illegal variable name.

# docker images
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
```

Adding `eval "$(docker-machine env default)"` on the second one I get the following error :


```
# docker images
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
```

How can I fix these errors ?


----------



## Amzo (Jul 8, 2021)

.cshrc is for the csh(1) which uses a different syntax for variables.

Try setting it in ${HOME}/.shrc and using /bin/sh as the shell.


----------



## ziomario (Jul 8, 2021)

ok. I don't see the previous error "illegal variable name",but docker is still not able to connect,as u can see below :

# docker images
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?


----------



## ziomario (Jul 8, 2021)

I've found the solution. How it works is explained here : https://github.com/docker/machine/ and it does not work if I'm root.


----------



## ziomario (Jul 8, 2021)

It seems broken even if I'm not root :

```
[zioma@lozioma ~]$ docker-machine create -d virtualbox default

Creating CA: /home/zioma/.docker/machine/certs/ca.pem
Creating client certificate: /home/zioma/.docker/machine/certs/cert.pem
Running pre-create checks...
(default) Image cache directory does not exist, creating it at /home/zioma/.docker/machine/cache...
(default) No default Boot2Docker ISO found locally, downloading the latest release...
(default) Latest release for github.com/boot2docker/boot2docker is v19.03.12
(default) Downloading /home/zioma/.docker/machine/cache/boot2docker.iso from [URL]https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso[/URL]...
(default) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Creating machine...
(default) Copying /home/zioma/.docker/machine/cache/boot2docker.iso to /home/zioma/.docker/machine/machines/default/boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
Error creating machine: Error in driver during machine creation: /usr/local/bin/VBoxManage sharedfolder add default --name hosthome --hostpath /home --automount failed:
VBoxManage: error: Shared folder path '/home' is not a directory
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component SharedFolderWrap, interface ISharedFolder, callee nsISupports
VBoxManage: error: Context: "CreateSharedFolder(Bstr(pszName).raw(), Bstr(szAbsHostPath).raw(), fWritable, fAutoMount, Bstr(pszAutoMountPoint).raw())" at line 1194 of file VBoxManageMisc.cpp
```


----------



## ziomario (Jul 8, 2021)

anyway :






						Ubuntu Pastebin
					






					pastebin.ubuntu.com


----------

