Tag Archives: VirtualBox

Copy Paste Hell Between Windows Host and Linux Guest in VirtualBox

Filed under Linux, VirtualBox
Tagged as , , ,

The X server maintains three different selection buffers, PRIMARY, SECONDARY and CLIPBOARD. The PRIMARY buffer is usually used for copying and pasting via the middle mouse button. And the CLIPBOARD buffer is used when the user selects some data and explicitly requests it to be “copied” to the clipboard, such as by invoking “Copy”.

The VirtualBox client tool synchronizes the Windows clipboard content to the PRIMARY and CLIPBOARD buffer of a Linux host. But it only synchronizes the CLIPBOARD buffer back out to the Windows host. The reason why it’s not using the PRIMARY selection is that by only selecting a text in Linux overwrites the Windows clipboard immediately, which is an unexpected behavior for Windows users. At least that’s their excuse.

It might not be the expected behavior for Windows users. But it’s definitely not the expected behavior for Linux users. The forums are filled with posts like “Copy/Paste from Linux guest to Windows doesn’t work”. It is especially annoying that the selected text from a terminal window can not be easily pasted out to the Windows host. There are a couple solutions. But none are really satisfying.

Read More »

Resizing a Linux Partition (Running in VirtualBox)

Filed under IT, Linux, VirtualBox
Tagged as , , , , ,

I was recently setting up a new test environment (BackTrack 5) inside a VirtualBox VM. Half way down the road of my project I realized that I was way to stingily with the amount of space I assigned to the virtual drive. Well, I thought no problem – I am going to enlarge the virtual drive. The steps would be easy:

  1. Enlarging the virtual drive
  2. Enlarging the partition holding the root file system with parted
  3. Enlarging the file system with resize2fs

Easy in theory. In reality it was still a little bit tricky.

Note, that everything that I describe in steps 2 and 3 also applies to a real linux machine. Step 1 is only necessary, because I happened to work inside a VM. On a real machine, step 1 would be something like copying the data of the old physical  drive onto a newer bigger drive with dd or the likes.

I also realize that there may be more professional programs like partition magic, which would have saved me some trouble. But I wanted to make it work right here and there with the things I had at hand. Which was parted. Or even the plain old fdisk would have done I guess.

It also goes without saying, that before you do things like this, that you need to make a backup if the data is of any value to you at all.

Read More »