Copying and pasting text between virtual machines and hosts

Source: Internet
Author: User
Tags file upload ssh server windows ssh client
We often execute commands in a Linux shell under a virtual machine platform, such as compiling or running some programs, and then trying to copy the wrong code or run to a Windows platform and paste it into an online forum for help. But directly under the virtual machine to copy the characters inside the shell, in the Windows environment is not pasted, how to make in the Windows environment to copy and paste the virtual machine inside the Linux shell characters, we can solve this problem in three ways.

One: Through SSH
This method requires the Linux installation SSH service within the virtual machine, which is installed by default. To ensure that the SSHD service is open, the Redhat platform can execute commands through the shell: Redhat-config-services, in the Pop-up Service Configuration window to see if the sshd service is turned on, if not on, tick the SSHD option, restart the operation. If Linux does not have SSH service installed, download the SSH pack and reinstall it.
SSH service after the operation of the Windows platform to download the SSH client installation, running the SSH client, click Quick Connect, enter the virtual machine Linux IP address, user name, port default 22, prompted to enter a password, you can log into the Linux SSH server. After login, Linux commands can be executed in the shell environment of the SSH client, as is done locally on Linux. In the shell environment of SSH, the characters within the current shell can be copied, and can be pasted within Windows. This allows you to paste some error messages after the execution of the command into a text file or paste it into a forum for help. It is also important to note that the Linux and local Windows IP addresses under the virtual machine should be on the same network segment, otherwise the SSH client is not connected to the Linux SSH server. Linux to set the network card IP command is ifconfig, such as: Ifconfig eth0 192.168.0.2, eth0 for the virtual machine default network card name.

Two: After VMware Tools has been installed through VMware Tools
     virtual machines, if you are running VMware tools, You can copy and paste text between a virtual machine and a host application or between two virtual machines.
to copy and paste:
     1.   Ensure that VMware Tools are installed and started in your virtual machine.
     2.   Select the items to copy in the source window using the operating system supported in the source window.
     3.   changes the cursor and keyboard control to the target window, and then pastes the items in the manner supported by the operating system in the target window.
You can only copy and paste text, not pictures or other items.
(how to use VMware tools to refer to relevant information)

Third: command redirection via Linux
Redirects the information returned by the execution Linux command to a text file, such as./gdbserver 192.168.0.1:1234hello>&info.txt, "&" means outputting all information. Then, in some way, info.txt the text file containing the output information back to Windows to view it. Many ways to copy, SSD, FTP, virtual machine with the shared file features, and so on. Here is a simple example, SSH itself with a file transfer function, Windows SSH client connected to the virtual machine server, click on the toolbar of the new File transfer window, you can open a similar cuteftp file transfer interface, Here can be a simple file upload and download, more convenient.

Three solutions are proposed here. If you often use SSH, no doubt the first approach is the most simple and convenient, and SSH itself is very powerful, while providing shell terminals, file transfer functions, easy to operate, and high security. If you do not use SSH, the second option is also more convenient, only to note that each time the host and the virtual machine copy the text before each other must run Vmware-toolbox, the method is the virtual machine installed VMware Tools are executed directly in the shell: Vmware-toolbox command. The third approach is more suitable for processing large amounts of data. If you want to copy and paste more text, you can use the file to transfer.

Note: The second method requires that you enter Vmware-toolbox in the terminal. Command, if gtk-warning * *: Failed to load Module "libgnomebreakpad.so": Libgnomebreakpad.so:cannot open Shared object file:no such file or directory error, there is a problem with the registration of the library file, please refer to the next article lost "LIBGNOMEBREAKP Ad.so "==failed to load module" libgnomebreakpad.so "

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.