mattia b
mattia b

Reputation: 105

Docker GUI with Mac how to

I am recently starting with docker and I am facing a problem in setting-up an existing docker-desktop image and showing is t on my screen. This will be the first step to then personalize the whole image:

I followed instruction from several sites but the easiest one is the following: dockerfile/ubuntu-desktop

The container inspection output is the following:

    $ docker inspect -f '{{json .NetworkSettings }}' 0792f104dfd0 
    {"Bridge":"docker0","Gateway":"172.17.42.1",
    "IPAddress":"172.17.0.21","IPPrefixLen":16,
    "MacAddress":"02:42:ac:11:00:15",
    "PortMapping":null,
    "Ports":{"5901/tcp":[{"HostIp":"0.0.0.0","HostPort":"5901"}]}}

When I try to connect with VCN I get errors.

Could you help me in finding what I should change to have a running, visible desktop on mac using Docker?

Upvotes: 0

Views: 2156

Answers (1)

Usman Ismail
Usman Ismail

Reputation: 18679

If you are just missing the .Xresources file try adding an empty file there. This discussion seems to imply that it is not really needed. You can add the file by using:

docker run -it --rm -p 5901:5901 -e USER=root dockerfile/ubuntu-desktop \
    bash -c "touch /root/.Xresources && \
    vncserver :1 -geometry 1280x800 -depth 24 && \ 
    tail -F /root/.vnc/*.log"

Docker on OSX (and any non-linux OS) runs inside a boot2docker vm and that VM's network is not available on localhost outside the VM. To get to the network interfaces use the Boot2docker IP which your can retrieve using the boot2docker ip command. This IP is usually 192.168.59.103 although that is not guaranteed.

Upvotes: 2

Related Questions