VirtualBox

Opened 16 years ago

Last modified 5 years ago

#1139 new enhancement

Feature request: wider copy/paste support, in Console for instance -> user contributions welcome — at Version 43

Reported by: Julien Bidault Owned by:
Component: clipboard Version: VirtualBox 1.5.4
Keywords: copy paste console Cc:
Guest type: other Host type: other

Description (last modified by Michael Thayer)

[This would be a candidate for user contributions, due to lack of core developer time. See comment:42 and comment:43.]

I'd like to see a wider copy/paste support, for exemple in console without X installed (typicall server config).

Beeing able to copy/paste from/to shell would be very nice for server config work, as many server daemon use text based configuration.

Use case :

  • (on windows host) : copy a config line from a webpage
  • (on linux guest, debian etch with Zsh) : open vi, then paste the config line

Another use case :

  • (on windows host) : copy a command line from a webpage
  • (on linux guest, debian etch with Zsh) : paste it on the shell to execute it

Another use case :

  • (on linux guest, debian etch with Zsh)) : copy the result of a command or a log file (from tail, more, cat, whatever)
  • (on windows host): paste it on a forum to seek for help

This would turn virtual box into a powerfull tool for learning server admin, or to use it as a copy of a production server where you can test modifications...

Change History (43)

comment:1 by Sander van Leeuwen, 16 years ago

priority: majorminor
Summary: Wider copy/paste support, in Console for instanceFeature request: wider copy/paste support, in Console for instance

comment:2 by Pistos, 16 years ago

+1

comment:3 by JF Lalande, 16 years ago

This could be really helpful to manage virtual operating systems that does not have an X server. I use virtual box to install debian kernels and test them and it's true that it's frustrating to not be able to copy/paste from firefox some long admin commands into the guest OS.

comment:4 by Frank Mehnert, 16 years ago

Component: otherclipboard

comment:5 by thewild, 15 years ago

+1

Copy/Paste to linux guests in console-only mode would be a huge improvement to VirtualBox.

comment:6 by wal, 15 years ago

Major pain not having this feature. Forces you to install Xorg and/or have an x-server if your host is windows. Should be more than minor priority.

comment:7 by Michael Thayer, 15 years ago

Perhaps this would be a good candidate for an external contribution? We currently don't have time to implement this, as we have more than enough other tasks to keep us busy, but we would be happy to help with the relevant VirtualBox interfaces.

comment:8 by Julien Bidault, 15 years ago

I wish I could help, but I only know how to code in Java which I guess is not of help here...I can assist with tests though

comment:9 by Michael Thayer, 15 years ago

#3293 has been marked a duplicate of this ticket.

Description:

Either by hotkey or by menu item VirtualBox could back-translate the text on the host clipboard to a sequence of physical key codes (according to host key mapping) and would send those keys to the guest. This would allow anyone to paste text from host to guest without requiring any form of guest support or driver. It would equally allow pasting to console or to a graphical editor, as long as host/guest key mappings do not differ too much.

comment:10 by Emerson, 15 years ago

+1

Really annoying thing..

comment:11 by Frank Mehnert, 15 years ago

Waiting for your patch.

comment:12 by Juergen Ulbts, 14 years ago

Another ping as the lack of a copy/paste feature is indeed very annoying.

comment:13 by Frank Mehnert, 14 years ago

Yes, and there are many other missing features which is annoying as well. Still waiting for patches.

comment:14 by Tom, 14 years ago

+1 for this. Very dissappointed to find it's not possible.

comment:15 by Michael Thayer, 14 years ago

cellingfish: very sorry that you are so disappointed. You must realise though that although VirtualBox is a very feature-complete piece of software there are still more useful features that could be added than our team can add in a reasonable time, and we have to make choices, normally based on what paying customers are interested in. This is one of the reasons why we make the source code available to the general public - so that people with different priorities to us can still add features which they want badly and which we do not currently have time to do.

comment:16 by wal, 14 years ago

Its actually not that much of an issue.(as I once commented on 2 years ago) All you need to do is putty into the machine; sure its not *ideal* but it sure beats typing out each command

comment:17 by Torsten Bronger, 13 years ago

Strangely, that's the only way to subscribe to bug reports here ...

comment:18 by Technologov, 13 years ago

+1. Useful.

-Technologov

comment:19 by Michael Smith, 11 years ago

+1 would enhance productivity as per the ticket description.

comment:20 by Michael Thayer, 11 years ago

Description: modified (diff)

Unfortunately it still doesn't look like we will be able to implement this in the foreseeable future. So if it is implemented it will probably have to be as a user contribution.

comment:21 by efferre, 11 years ago

+1

comment:22 by xpt, 11 years ago

This is such a fundamental request for Linux server/console. Mouse & copy/paste is supported within Linux console mode by gpm, but not to/from the host through virtualbox.

I can't believe that virtualbox/oracle kept turning a deaf ear to the strong request, and downplaying such fundamental feature as minor for five straight years.

Sigh, oracle, oracle, oracle ...

comment:23 by Michael Thayer, 11 years ago

As I mentioned in a previous comment, VirtualBox is open source, and while I appreciate that some areas of the source code are rather hard to get to grips with, this is one area which I think would be quite manageable for anyone interested in contributing. The fact that no one has even attempted this suggests that perhaps the interest on the part of the user community is not quite as high after all.

comment:24 by Frank Mehnert, 11 years ago

I removed the last insulting comment.

comment:25 by amadis, 10 years ago

Hi! It is really nice and required feature. Many admins install guest linux systems without X11 support to test console/daemon applications. And get no clipboard support... Please include support console/host system clipboad integration via gpm.

comment:26 by Klaus Espenlaub, 10 years ago

You're all requesting the impossible, I investigated the options... the way the linux console copy/paste support is implemented (to support gpm) does NOT allow any access of the marked text for transferring to the host or in the other direction injection of the host's clipboard content into the terminal.

So until someone makes a proposal which has a chance of success this feature request is completely on hold.

in reply to:  26 comment:27 by maciej, 10 years ago

Replying to klaus:

You're all requesting the impossible, I investigated the options... the way the linux console copy/paste support is implemented (to support gpm) does NOT allow any access of the marked text for transferring to the host or in the other direction injection of the host's clipboard content into the terminal.

Pasting into Guest OS should be always possible and e.g. Microsoft Virtual PC can do! When there is no possibility to communicate with Guest OS, VirtualBox should send keystrokes to simulate keyboard typing.

comment:28 by Will Pittenger, 8 years ago

I'm unable to understand why this hasn't been implemented by now. It's 7 years old. I see it as VERY handy.

comment:29 by Frank Mehnert, 8 years ago

So where is your code contribution? Even if a feature request was submitted many years ago that doesn't mean it's priority is increased. The VirtualBox team has limited resources and you only need to have a quick look at the open issues listed in this bugtracker.

comment:30 by Socratis, 7 years ago

OK, I'll bite. What are we talking about here?

  • The part that can send keystrokes. Already there (even complicated ones).
  • The part that gets access to the host's clipboard. Already there.
  • Is the only thing missing, the glue? A small parser/checker of the contents of clipboard and running them through the keypress function?

Am I missing something not that evident? And if not, any push to the general direction would be appreciated.

comment:31 by Michael Thayer, 7 years ago

What did you have in mind?

  • Emulating keystrokes? The annoying bit there would be working out the guest keyboard layout.
  • Writing text to the device node representing the current virtual console? I have not experimented to see how that might work, but if you feel like trying that you would be best using the VBoxClient clipboard code as documentation (but probably working directly with the VBoxGuestLib clipboard parts rather than actually re-using code) and writing a small daemon. It would also require a bit of study to find out how to actually do that in Linux (might well be portable to other UNIX-like systems), and you might want to start by writing a dummy first which e.g. too text to paste from the command line, and change it to read the host clipboard once that was working.
  • Using the GPM interface? Can't really comment, never had time to study it.

comment:32 by Socratis, 7 years ago

The first one; emulating keystrokes. From a single keyboard layout; QWERTY ANSI/ISO, just to cover the basic ASCII, from 0x20 to 0x7e with 0x0a and 0x0d (the last two with a question mark). That's it. Period.

Unless a key code sends a different character from QWERTY to QWERTZ to AZERTY. Then, no.

But, do you mind if we continue the discussion in the forums (https://forums.virtualbox.org/viewtopic.php?f=9&t=80315), since I don't feel quite good about everybody being bombarded by e-mail for every reply? I see that you've already started there ;)

comment:33 by Mauro Molinari, 6 years ago

+1 Really need to be able to copy 'n' paste from Linux guest to Linux host terminal and viceversa.

comment:34 by Socratis, 6 years ago

@mauromol
If you look at the thread in the forums that's linked above your post, you'll see that this issue has been Fixed with VirtualBox 5.2.0. You can "paste" into the console.

Of course the reverse is not going to happen, because it would require a program running on the guest, something like a "Guest Additions" type of program. And since the majority of the guests that this ticket was targeting, does not have GAs, it's not going to happen...

comment:35 by Will Pittenger, 6 years ago

@socratis Even for pure non-graphical text screens?

comment:36 by Socratis, 6 years ago

WillPittenger,
Yes. If you look at my post in the thread in the forums, I give two examples for a FreeDOS VM. No GUI whatsoever, as pure as CLI can be! ;)

in reply to:  34 ; comment:37 by Mauro Molinari, 6 years ago

Replying to socratis:

@mauromol
If you look at the thread in the forums that's linked above your post, you'll see that this issue has been Fixed with VirtualBox 5.2.0. You can "paste" into the console.

Thanks for pointing it out. Some explanation here would have been useful though. Also, the provided solution is quite complicated and hidden. Why not adding some menu item in the VM window to perform this?

Of course the reverse is not going to happen, because it would require a program running on the guest, something like a "Guest Additions" type of program. And since the majority of the guests that this ticket was targeting, does not have GAs, it's not going to happen...

Why not? I do have guest additions installed on my guest system and I would have expected this to work exactly because of this reason.

in reply to:  37 ; comment:38 by Socratis, 6 years ago

Replying to mauromol:

the provided solution is quite complicated and hidden.

Do you have a better suggestion? It sure as heck beats the "non-existent feature". Did you notice the age of the ticket? Yes, it was that high of a priority... ;)

Why not adding some menu item in the VM window to perform this?

As I've said in the forums in related discussions, this could be the next step. Before that you'd need to write a clipboard parser (doesn't exist so far) and start potentially going through a series of warnings, if a random idiot would try to paste a picture, HTML/RTF text, an MP3 file, a video from their vacation, etc, etc, etc.

The good news on the other hand is that the HostKey+V is not reserved for anything else! But the shortcut is actually the last part, the "we're getting fancy now" part. ;)

Look, bottom line is that this is an advanced feature. It's not a clicky-clicky thing. Yet.

I do have guest additions installed on my guest system and I would have expected this to work exactly because of this reason.

No, you wouldn't expect that. Not unless you understood that the Guest Additions (GAs) hook to the X11 clipboard. If you're not running X11, there's no X11 clipboard, there's no Copy/Paste. The logic is amazingly simple...

If you wanted something like that, you'd be forced to write several command line hook processes for a variety of setups/OSes, and you still wouldn't be covered.

The paste from the host (where the host actually controls each and every guest because it mimics the hardware) took about 10 years. Do you want to take a wild guess as for the future of this not-yet-existent feature that you're requesting? Pasting from any guest to the host? Potentially breaking security because now each and every guest could inject keystrokes on the host?

This was a small step for VirtualBox, a huge step for those that write testing suits for all sorts of guests. Or automate their scripts, like doing cross-platform compiling on headless guests.

in reply to:  38 comment:39 by Mauro Molinari, 6 years ago

Replying to socratis:

Why not adding some menu item in the VM window to perform this?

As I've said in the forums in related discussions, this could be the next step. Before that you'd need to write a clipboard parser (doesn't exist so far) and start potentially going through a series of warnings, if a random idiot would try to paste a picture, HTML/RTF text, an MP3 file, a video from their vacation, etc, etc, etc.

AFAICT, the clipboard contents usually also carry on information about their type, so that the same contents may render differently when pasted on an application that just supports text, rather than graphics, videos, actual files and so on. I think this is done in collaboration with the source application, that provides different "views" of the same contents for different target MIME types. In other words, the intersection between content types supported by the source and the target must be non-empty. But AFAICT, this is the normal contract. So I don't think a "clipboard parser" would be needed to handle this, VirtualBox may simply refuse to do anything when the clipboard contents does not support pasting as text/plain contents.

Look, bottom line is that this is an advanced feature. It's not a clicky-clicky thing. Yet.

I'm not saying this is easy or straightforward to implement, I'm just saying it would be extremely useful.

I do have guest additions installed on my guest system and I would have expected this to work exactly because of this reason.

No, you wouldn't expect that. Not unless you understood that the Guest Additions (GAs) hook to the X11 clipboard. If you're not running X11, there's no X11 clipboard, there's no Copy/Paste. The logic is amazingly simple...

From a user point of view, this is just an "implementation detail". Guest Additions are supposed to deliver the "shared clipboard" feature. If the guest is not running X11, I would expect Virtual Box to use some other mechanism to provide this feature. Or at least I would hope so :-) Once again, I'm not saying this is trivial to do. I'm just saying it would be an extremely useful feature.

If you wanted something like that, you'd be forced to write several command line hook processes for a variety of setups/OSes, and you still wouldn't be covered.

Supporting the most common setups (Linux, for instance) would certainly be better than nothing ;-)

The paste from the host (where the host actually controls each and every guest because it mimics the hardware) took about 10 years. Do you want to take a wild guess as for the future of this not-yet-existent feature that you're requesting? Pasting from any guest to the host? Potentially breaking security because now each and every guest could inject keystrokes on the host?

And what about a different approach? For instance by using the mouse pointer integration? I can select text in my guest text console, I just can't tell VB to "copy" it to the clipboard.

comment:40 by Socratis, 6 years ago

Fair points, all of them except a couple...

From a user point of view, this is just an "implementation detail". Guest Additions are supposed to deliver the "shared clipboard" feature. If the guest is not running X11, I would expect Virtual Box to use some other mechanism to provide this feature.

Please think out loud what that "other mechanism" should be. Because AFAIK, clipboard doesn't exist in most of the console-land. And don't think in your specific distro only. Think... DOS.

For instance by using the mouse pointer integration? I can select text in my guest text console, I just can't tell VB to "copy" it to the clipboard.

First of all, the mouse pointer integration is not universal. Second, I'm not sure if anything less than OCR would be required in that case. VirtualBox doesn't know what's on the screen and try to make heads or tails about your intentions. Selected text? How exactly would you detect that? In DOS...

And no, a keyboard monitoring filter is not a solution either, in case you were thinking about something like that.

comment:41 by Martijn071, 5 years ago

My cloud VPS provider (TransIP.eu) uses a variation of this. No direct pasting but rather an helper. Click on "paste to console", a textbox within user interface appears and you can paste your text here. When done, click "send" and the text pushed to the console (via emulating keyboard??) https://www.transip.eu/knowledgebase/entry/125-what-is-the-vps-console/#the_pop-out_window Is this perhaps a possibility? Then the whole clipboard thing and keyboard monitoring thing can be ignored.

comment:42 by Socratis, 5 years ago

You know what the problem is? That this thread is still marked as "new", and not as "fixed with 5.2.0". Also contributing to the confusion, might be the fact that there's not anything related to the User Manual, except a simple reference to the actual implementation, as below...

@Martijn071, please read the thread from the beginning, this *has* been implemented, since 5.2.0:

VBoxManage controlvm <uuid|vmname>
                     keyboardputscancode <hex> [<hex> ...]
                     keyboardputstring <string1> [<string2> ...]
                     keyboardputfile <filename>

For details see: https://forums.virtualbox.org/viewtopic.php?f=9&t=80315&start=15#p414817

comment:43 by Michael Thayer, 5 years ago

Description: modified (diff)
Summary: Feature request: wider copy/paste support, in Console for instanceFeature request: wider copy/paste support, in Console for instance -> user contributions welcome

This feature could definitely bear some improving I agree. For instance a way of specifying the guest keyboard layout when sending scan codes (we currently assume US). Currently though no one on the team has time to work on it, or is likely to for the foreseeable future. Contributions are welcome from anyone for whom this feature is sufficiently important. An e-mail to vbox-dev before starting would be good to be sure that what you plan would be a good fit.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use