Reputation: 105
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
When I run it I obtain the following output:
$ docker run -it --rm -p 5901:5901 -e USER=root dockerfile/ubuntu-desktop bash -c "vncserver :1 -geometry 1280x800 -depth 24 && tail -F /root/.vnc/*.log"
You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
New 'X' desktop is 0792f104dfd0:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/0792f104dfd0:1.log
03/02/15 14:10:08 Copyright (C) 2000-2007 TightVNC Group
03/02/15 14:10:08 Copyright (C) 1999 AT&T Laboratories Cambridge
03/02/15 14:10:08 All Rights Reserved.
03/02/15 14:10:08 See http://www.tightvnc.com/ for information on TightVNC
03/02/15 14:10:08 Desktop name 'X' (0792f104dfd0:1)
03/02/15 14:10:08 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
03/02/15 14:10:08 Listening for VNC connections on TCP port 5901
Font directory '/usr/share/fonts/X11/Type1/' not found - ignoring
Font directory '/usr/share/fonts/X11/75dpi/' not found - ignoring
Font directory '/usr/share/fonts/X11/100dpi/' not found - ignoring
xrdb: No such file or directory
xrdb: can't open file '/root/.Xresources'
AUDIT: Tue Feb 3 14:10:09 2015: 17 Xtightvnc: client 6 rejected from local host
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
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