(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 like “links” on Kubernetes
  • create_network(): failed to allocate gateway (x.x.x.x): Address already in use in test case
  • Docker - is it necessary to push images to remote server?
  • Kubernetes NFS volume mount fail with exit status 32
  • Bluemix Unable to connect or ping to container
  • Hide/obfuscate environmental parameters in docker
  • #! /bin/bash
    xhost +localhost &

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

    ssh ubuntu@IP -Y

  • How to deal with automatic capistrano symlinks and docker volumes
  • Docker 1.3 fails to start on RHEL6.5
  • What is the difference between Docker Swarm and Kubernetes/Mesophere?
  • Is there anyway to have a DockerBuild file use an environment variables file?
  • How do I set up a simple dockerized RabbitMQ cluster?
  • run a meteor app on docker - doesn't open in localhost
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.