title: xclip gives `Error: Can't open display: localhost:10.0` in tmux session in Ubuntu VirtualBox VM
body: <p>I'm attempting to use xclip in a tmux session in my Ubuntu VirtualBox VM for some copy/paste keybindings, but keep getting the same error message. </p>
  
  <p>I have XQuartz installed on my host machine: </p>
  
  <pre><code>ysim:~$ which xquartz
  /opt/X11/bin/xquartz
  ysim:~$ echo $DISPLAY
  /tmp/launch-N0023n/org.macosforge.xquartz:0
  </code></pre>
  
  <p>I have <code>ForwardX11 yes</code> set in <code>~/.ssh/config</code>: </p>
  
  <pre><code>Host vm
  ForwardX11 yes
  </code></pre>
  
  <p>In my VM too, in <code>/etc/ssh/sshd_config</code>:</p>
  
  <pre><code>X11Forwarding yes
  </code></pre>
  
  <p>When I'm ssh'ed in my VM, xclip works fine when I'm <em>not</em> in a tmux session: </p>
  
  <pre><code>$ echo hello | xclip
  $ xclip -o
  hello
  </code></pre>
  
  <p>But errors when I'm in one:</p>
  
  <pre><code>$ echo hello | xclip
  Error: Can't open display: localhost:10.0
  </code></pre>
  
  <p>Any ideas why this might be the case? </p>
  
  <p><strong>Update:</strong> Now it seems to only happen if I exit a tmux session, then create a new one. </p>