I run linux via VirtualBox on OS X. I do this by running my VM in a headless state and then sshing to the linux machine using port forwarding. Right now whatever is copied to my clipboard on my virtual machine I am able to paste on my remote ssh session, but not vice versa (copying from tmux copy mode). I have tried using the following tmux configurations:
setw -g mode-keys vi
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "tmux save-buffer - | ssh host pbcopy"
Unfortunately this is not working... Manually copying using my mouse works but tmux copy mode is more convenient. Any ideas?
The solution is to use tmux specific controls to access its own scrollback buffer: Ctrl-b then [ to enter copy mode, use Down/Up arrows or PageDown and PageUp keys, q or Enter to exit copy mode.
This needs integrating tmux buffers with OSX clipboard. What you are trying to do with ssh host pbcopy
is just that but I don't think your setup is correct.
host
here should be your local OSX machine. And you should have password less key-based trust established between your OSX username and remote user where you are running tmux.
Step 1. Enable SSH on your OSX
Goto System preferences -> Sharing
and enable Remote Login
. Also remove administrators from the list and add your username.
Step 2. Setup password less login.
These are the steps
Step 3. Replace your host
with 192.x.x.x
or whatever your OSX's ipaddress is which is reachable from your Virtualbox
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With