如何使用mac键盘粘贴到虚拟框中的terminallinux?

我正在使用Mac,我已经在虚拟盒子上安装了debian linux。 我想从我的Mac复制到虚拟框中的terminallinux的URL。 我怎样才能做到这一点?

有时候,在Mac上打开一个终端然后通过SSH连接到VirtualBox guest更容易。 这样可以避免很多焦点转换的麻烦

我只是有同样的问题。 确保剪贴板共享打开后,按Ctrl + Shift + V粘贴到debian中的终端。

我只是写了一个指导,让VirtualBox上的OS X和Ubuntu之间的复制和粘贴工作,因为它已经令我沮丧。 也许帮助遇到这个问题的人:

http://blog.nostopbutton.com/2013/08/24/setup-copy-and-paste-between-os-x-and-linux-virtualbox/

第一
安装Guest Additions CD(设备 – Devices->Insert Guest Additions CD image )。

激活剪贴板共享
然后在重新启动后,在Virtualbox中,进入Machine->Settings->General->Advanced并设置
Shared Clipboard: Bidrectional

更改VirtualBox主机密钥
Vitualbox/Preferences/Input/Virtual Machine/Host Key Combination
选择不同的然后

密钥映射
对于我添加英文(Macintosh)键盘的cmd/ctrl映射似乎是最舒适的解决方案:)

进入Ubuntu Settings->Text Entry
(我猜老版本可能在键盘布局设置)
Input sources to use:加号(+)
添加English (Macintosh)

我使用的是VirtualBox 5.0.4中的Ubuntu 14.04.3 LTS 64bit

我已经编写了一个页面描述如何做到这一点

简短的版本是,你可以使用AppleScript和自定义键盘快捷方式来做到这一点。

AppleScript的:

 on run {input, parameters} set input to input as text tell application "System Events" repeat with currentChar in the characters of input set cID to id of currentChar set used to false repeat with r in {{48, 29}, {49, 18}, {50, 19}, {51, 20}, {52, 21}, {53, 23}, {54, 22}, {55, 26}, {56, 28}, {57, 25}, {45, 27}, {46, 47}, {47, 44}, {61, 24}} if first item of r is equal to cID then -- 0-9 -./= key code (second item of r) set used to true end if end repeat repeat with r in {{42, 28}, {43, 24}} -- *+ if first item of r is equal to cID then key code (second item of r) using shift down set used to true end if end repeat if not used then keystroke currentChar end if end repeat end tell return input end run 

这个脚本对于愚蠢地阻止粘贴的密码字段也是有用的。

我用我的Windows机器与虚拟机连接PuTTY,FileZilla等Ubuntu的Ubuntu

(不使用默认的virtualbox控制台)

这里是你如何从头开始设置你的:

 ### Setup Virtualbox: https://www.virtualbox.org/wiki/Downloads install ubuntu from their website ### Launch Ubuntu from Virtualbox Console: sudo apt-get install openssh-server sudo systemctl start ssh sudo systemctl status ssh netstat -tulpn # see ubuntu port 22 open and ssh running sudo poweroff ### Virtualbox: settings - network - Advanced - Adapter Type: PCNet Fast 3 - Port Forwarding Name: SSH, Protocol: TCP, Host Port (Windows): 3022, Guest Port (Ubuntu): 22 right click - start - headless start ### PuTTY: Seesion: Localhost Ubuntu: <your_user> -p Host: <your_user>@127.0.0.1 Port: 3022 Window - Colums: 130, Rows: 24 Scrollback lines: 10000 Appearance - Cursor: Vertical + Blinks Font Courier New - Regular - 12px Behaviour - Window Title: Localhost Ubuntu Full screen on ALT + ENTER Connection Data - Auto login Username: <your_user> Session - SAVE! ### FTP: Host: localhost Port: 3022 SFTP (SSH FTP) Logon Type: normal <your_user> <pass> Transfer settings: limit max. conenction: 4 ### Git BASH: ssh -p 3022 <your_user>@localhost ### Enable SSH Root Login: (Use only on localhost, security advice!) # Set a password for root account first and then enable root account: sudo passwd root sudo passwd -u root # Reverting Back: (lock the root account) sudo passwd -l root # Enable SSH root login: sudo nano /etc/ssh/sshd_config # PermitRootLogin prohibit-password PermitRootLogin yes sudo systemctl restart ssh ### Virtualbox Windows Headless Start # Make a .lnk shortcut with target or .bat batch file "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm "UbuntuMin" --type headless "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "UbuntuMin" poweroff Add shortcuts to start menu -> ubuntu START & STOP - change .ico - right click - pin to start