- Activate virtualbox, access to
setting > general > advance
and change virtualbox's clipboard sharing to "bidirectional". - Install deps by references to
setup-ubuntu.sh
in your GuestOS (ex: ubuntu). - Put the content of
.zshrc
to your guest machine's rc-file.
Last active
January 19, 2022 13:53
-
-
Save ktrysmt/7a969e5cecd7328b2f184fc150368c7d to your computer and use it in GitHub Desktop.
How to share clipboard between HostOS and GuestOS of Vagrant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export DISPLAY=:0 | |
if [ -x /usr/bin/Xvfb ] && [ -x /usr/bin/VBoxClient ] && [ ! -f /tmp/.X11-unix/X0 ]; then | |
nohup Xvfb -screen 0 120x80x8 > /dev/null 2>&1 & | |
sleep 0.5 | |
VBoxClient --clipboard | |
fi | |
if [ -x /usr/bin/xsel ]; then | |
alias pbcopy='xsel --display :0 --input --clipboard' | |
alias pbpaste='xsel --display :0 --output --clipboard' | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get -y install Xvfb xsel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is exactly what I was looking for, thanks for sharing!