(spotify:1): Gtk-WARNING **: cannot open display: unix

I try to run the spotify docker container. I have docker 1.11.2 installed on Ubuntu 14.04 VM.
I’m on MAC and I’m using SSH to connect with my VM.
It’s working fine but when I try to run the docker container I get an error:

ubuntu@ubuntu-virtual-machine:~$ docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY -v /dev/snd:/dev/snd --privileged --name spotify jess/spotify

(spotify:1): Gtk-WARNING **: cannot open display: unix

How can I fix this? I tried already some things I read on the internet like:
edit ~/.xinitrc and put the following in it:

  • Docker with nodeBB redis is not configured properly?
  • docker-registry v2.2.0 S3 config not overwritten
  • Docker and Nginx proxy_pass between containers
  • Connect docker containers directly to host subnet
  • Elasticsearch-Hadoop library cannot connect to to docker container
  • Self hosted kibana 5.1.1 showing blank pages after connected to AWS Elasticsearch 5.1.1
  • #! /bin/bash
    xhost +localhost &

    Also tried to ssh to my ubuntu in the following way:
    ssh ubuntu@IP -X and

    ssh ubuntu@IP -Y

  • AWS BeanStalk environment running multi-container Docker fail to start with Health: Severe
  • Using ENV variables in daemonized Docker running RStudio
  • How to COPY files of current directory to folder in Dockerfile
  • Debugging a bash script in a container gives a process on the host?
  • Clone server to docker image
  • Need to take image of docker image or container from application installed machine in AWS
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.