How to copy files into a virtual box oracle box - oracle

I am using oracle box with windows and I have to keep re-plugging in my usb for it to recognise. I want to copy files into the virtual machine but it does not let me do this so this is what I have resorted to.
In general settings I Have enabled shared clipboard and drag n drop.
I've found it's easier just using my laptop for testing but this is just not as convenient. Strangely, my linux OS in my VM works fine and can copy and paste into it from my main os. How do I allow copy and paste for windows? I'm current doing a reinstall of windows os on vm and seeing if that helps.
My question, how do I copy and paste into virtual box with windows. Failing that, how can I get my virtual box to recognise my usb without replugging it in and out all the time. Either workaround is useful.
Thanks.

A nice solution could be to share a directory on your host machine with the virtual machine, so you can copy your files in and out.
Look at:
How to share your computer files with a virtual machine

Just create ISO file from folder and then mount, or copy files to USB Stick and then mount to VM
Folder2Iso

The most easy way I found is to use Google Drive. Other options include: OneDrive, Dropbox, Email, etc.

Related

Is it possible to apply unattend.xml on custom prepared image when deploy new PC?

I've created custom Windows_10_PRO_1909_x64 image with hashicorp packer (with QEMU).
To build it I used unattend.xml file. Steps to prepare were:
Absolutely unattended installation of Windows
Installation of big amount of software
Converting VM (it was build with QEMU) to raw .img file
Now I want to deploy this image to new PC. I'm using bootable USB stick with embedded Linux (also custom) which can grab this .img file from local storage and write to /dev/sda
Everything works fine in this process.
Main problem is - after writing .img to /dev/sda I'm changing ComputerName in unatted.xml file (on mounted /dev/sda), but after first time boot, Windows ignores this file, and PC name is the same as it was before changing. When I checked unattend file, it has correct PC name, which I changed while was on bootable linux, before Windows first run.
Maybe somebody have an idea - how I can change PC name, each time I deploy new PC? But it should be without user interaction. It could be any file modification on bootable linux, or maybe there is a way to do it automatically on first Windows boot?
Found solution.
Need to run sysprep afer Windows install with sysprep-unattend.xml file to clean system.
After it Windows will catch this file on first boot. So it's possible to change PC name in this file before boot.

Edit files in a Virtualbox VM (vagrant box) from host

I was messing with systemd in my Vagrant box and I think I did something wrong since the box won't boot anymore. What I need to do is to remove certain files under /etc/systemd in my Vagrant box. However since I can't boot it, I have to remove those files from the host, but I don't know how to do it.
The VM provider is virtualbox. Both the host and the guest are ubuntu 15.04.
Thanks in advance!
option 1: you can try to add vagrant ssh -c 'cmd to run' in your vagrant file, but as you said it really does not boot, I give it really low chance to success.
option 2: create a new VM and add the hard drive from the old box to the new box (add new hard drive from existing disk), boot it and you might need to mount the new hard drive then you should be able to access your data so make the change in your /etc/systemd or whatever files you need and save. once you have made all your fix, you should be able to reboot from the old vm.
I ended up just creating a new VM but I'm fairly certain that this would work: you just mount the virtual disk file (.vmdk in my case) as a hard drive and make the fix. For different formats of virtual disks you need different tools to mount them, which I'm not going to cover here.

Shared folder between MacOSX and Windows on Virtual Box

I need to set up shared folder.
I've got Mac OSX Yosemite host and clean Win7 x64 on the VirtualBox.
In MacOSX, i go to the VirtualBox -> win7 settings -> "Shared Folders" -> Add shared folder ->
creating folder /Users/my_name/Documents/win7 -> Make it permanent -> Click ok.
What i should do in Windows then?
Thank you.
Edit
4+ years later after the original reply in 2015, virtualbox.org now offers an official user manual in both html and pdf formats, which effectively deprecates the previous version of this answer:
Step 3 (Guest Additions) mentioned in this response as well as several others, is discussed in great detail in manual sections 4.1 and 4.2
Step 1 (Shared Folders Setting in VirtualBox Manager) is discussed in section 4.3
Original Answer
Because there isn't an official answer yet and I literally just did this for my OS X/WinXP install, here's what I did:
VirtualBox Manager: Open the Shared Folders setting and click the '+' icon to add a new folder. Then, populate the Folder Path (or use the drop-down to navigate) with the folder you want shared and make sure "Auto-Mount" and "Make Permanent" are checked.
Boot Windows
Once Windows is running, goto the Devices menu (at the top of the VirtualBox Manager window) and select "Insert Guest Additions CD Image...". Cycle through the prompts and once you finish installing, let it reboot.
After Windows reboots, your new drive should show up as a Network Drive in Windows Explorer.
You should map your virtual network drive in Windows.
Open command prompt in Windows (VirtualBox)
Execute: net use x: \\vboxsvr\<your_shared_folder_name>
You should see new drive X: in My Computer
In your case execute net use x: \\vboxsvr\win7
Using a Windows 10 guest, after I performed steps 1 through 3 from #xinampc's answer, I had to open a new File Explorer and navigated to This PC > CD Drive (D:) VirtualBox Guest Additions to run VBoxWindowsAdditions. After I ran that and went through the command prompts, Windows rebooted and I was able to see VBOXSVR under Network.
Yesterday, I am able to share the folders from my host OS Macbook (high Sierra) to Guest OS Windows 10
Original Answer
Because there isn't an official answer yet and I literally just did this for my OS X/WinXP install, here's what I did:
VirtualBox Manager: Open the Shared Folders setting and click the '+' icon to add a new folder. Then, populate the Folder Path (or use the drop-down to navigate) with the folder you want shared and make sure "Auto-Mount" and "Make Permanent" are checked.
Boot Windows
Download the VBoxGuestAdditions_4.0.12.iso from http://download.virtualbox.org/virtualbox/4.0.12/
Go to Devices > Optical drives > choose disk image..
choose the one downloaded in step 3
Inside host guest OS (Windows 10, in my case) I could see:
This PC > CD Drive (D:) Virtual Guest Additions
For now, right click on it, select Properties, the Compatibility tab, and select Windows 8 compatibility there. Much easier than using the compatibility troubleshooting I did initially.
reboot the guest OS (Windows 10)
Inside host guest OS, you could see the shared folder
This PC> shared folder
It worked for me so I thought of sharing with everyone too.
I had the exact same issue, after rightly have configured in Mac OSX host a SharedFolder with Auto-Mount enabled.
On the Guest OS, it is also required to install VirtualBox Guest Additions. For the case of Windows, it is:
VBoxWindowsAdditions.exe
Right after this installation, i could perfectly view the shared folder content under This PC and Network ("\VBOXSVR\Installers").
At first I was stuck trying to figure out out to "insert" the Guest Additions CD image in Windows because I presumed it was a separate download that I would have to mount or somehow attach to the virtual CD drive. But just going through the Mac VirtualBox Devices menu and picking "Insert Guest Additions CD Image..." seemed to do the trick. Nothing to mount, nothing to "insert".
Elsewhere I found that the Guest Additions update was part of the update package, so I guess the new VB found the new GA CD automatically when Windows went looking. I wish I had known that to start.
Also, it appears that when I installed the Guest Additions on my Linked Base machine, it propagated to the other machines that were based on it. Sweet. Only one installation for multiple "machines".
I still haven't found that documented, but it appears to be the case (probably I'm not looking for the right explanation terms because I don't already know the explanation). How that works should probably be a different thread.
A Shared Folder requires Guest Additions but to get Guest Additions to work I had to use the following steps.
Enable Shared Folder
Add permanent shared folder
Settings > Shared Folder > New Folder
Select host OS folder
Give it a name without spaces
Check auto mount and make permanent, if available
Leave mount point blank
( Shared folder will be in This PC > Network Locations , after the guest additions have been added and the VM restarted.)
Add guest additions
Add optical drive
VirtualBox > Settings > Storage
On the IDE controller click the "Add new storage attachment" > Optical > Leave Empty
(Do not select the VBoxGuestAdditions.iso image as the installers won't run as expected within the VM.)
Start the Machine
In the Devices Menu in the MacOS bar, select Insert Guest Additions CD Image...
Follow prompts for install
Restart machine

VMWare: File not Found, on Mac OS 10.10 Yosemite

I'm having trouble opening VMWare on my Mac pro OS 10.10. I didn't do anything, moving its files or anything. I just turned my Mac off before I went to bed last night, and then this morning, when I tried to open VMWare again on my Mac, it keeps giving me this waring:
File not found.
I'm very confused, I've important files storing on my Windows workspace and need to have it restored.
What I've tried:
I've uninstalled VMWare on my machine, and re-downloaded and reinstalled it back, but, no luck, still the same warning. VMWare doesn't open at all.
I've also restarted my machine, hoping that something magic can happen, but unexpectedly, no luck.
OK, question resolved after I went to the Tech Stop at my University.
We just found that Windows 7 was somehow gone in my VMWare, then we opened Virtual Machine Library of VMWare, then re-installed Win7 into this VMWare, as this picture shows: http://postimg.org/image/blnk4x59z/
Now things are working fine.
Some other people might run into the same issue in the future, I don't know why this happened and nobody really knows what's going on.
I called VMWare tech support, but they don't provide any help since I downloaded it for free from our CS department website. But our department tech assistance has never met this issue. So nobody to turn to.
But anyway, pretty simple to fix:
Just re-install win7 in your VMWare, if you run into the same case as I did, by opening your Virtual Machine Library.
I experienced the same symptom after rebooting my Mac. SSun's answer helped me to solve it, but I think I can offer a bit of further insight.
VMWare Fusion was actually launching successfully, but when attempting to open a machine that was open at last quit, it fails to find the machine's files. I mis-interpreted the message as meaning that VMWare couldn't find an internal file and thought it had failed to launch. I got the same error when attempting to reinstall.
SSun refers to re-installing a guest OS. To be specific, one just needs to delete the reference to the virtual machine in VMWare (after dismissing the popup and you can access to the Window menu and open your virtual machine library); not reinstalling the actual guest OS. One can then recreate the reference by opening the machine via File > Open. Alternatively, resolve the root cause of the machine not being found.
In my case the root cause was that the virtual machine resided on a different hard drive to Mac OS and was referenced via a symlink. This hard drive had failed to mount automatically at boot up.
The same confusing error occurs when reinstalling because at the end of the install, VMWare launches automatically, triggering the symptom again.
I followed the steps from kb.mit.edu below to resolve this issue:
Click OK to close the error message.
Close the Virtual Machine. Click the red dot in upper left hand
corner or execute the keyboard shortcut Command+W
Follow the menu path Window >> Virtual Machine Library to open the
Virtual Machine Library.
Right-click on the thumbnail image for the VM or hold down the Ctr
key while clicking on the thumbnail image for the VM. Result: A
drop-down menu appears.
Select Delete Result: Remove Virtual Machine dialog box appears, with
options to Cancel, Move to Track or Keep File.
Choose Keep File.
However after doing the above, I found out that you need to resart your machine for eveything to work properly, else the problem will still persist.
If you get this error – including after deleting a VM (i.e., you cannot do anything inside the VMWare Fusion app to resolve this) – I found that the following will work, without reinstalling the app, deleting its preferences, or rebooting the host Mac, but at the tiny cost of having to re-add your VMs to the list of the available ones (a simple drag-and-drop operation):
Shut down any running VMs that are functioning, then shut down VMWare Fusion.
Trash the "~/Library/Application Support/VMware Fusion/vmInventory" file
Open the Activity Monitor app, search for "vm", and shut down everything with "vmware", "vmnet", and "vmrest" in its name. (Or do effectively the same thing in the Terminal, with ps aux | grep vm and then kill -9 on each of the appropriate process numbers, if you're command-line-oriented.)
Go find your VMs in Finder.
Restart the VMWare Fusion application.
Drag each of your VM packages to VMWare and drop it on the now-empty left pane of the Virtual Machine Library window to re-add the the VM to the list.
Test-start each of them to make sure you didn't break anything. [This is the paranoia option, here.]
Restart VMWare to make darned sure it writes out new config files. [My trust level in this app is quite low of late.]

Virtual Box Shared folders on Mac backup to external harddrive

So I found out how to share folders using Virtual Box and running Windows 8.
I was wondering, if I save files or projects from Windows 8 to the shared folder on my Mac, will TimeMachine backup those files onto my external harddrive? The hard drive is of course formatted for Mac because of that whole debockel, but that is besides the point. Even though the files were made in Windows.
Also...My assumption is that I would not be able to access the files on my external formatted hard drive from Virtual Box running Windows 8. Is this true?
To my knowledge, you cannot access the files on a journaled formatted hard drive from Windows without extra software. If I understand you correctly, you are trying to backup files created in the Windows VM within your Time Machine backup hard drive?
I'm sure you have solved this by now, but you should consider backing up the VM itself. If the files on the Windows Machine are important you can leave them in a shared folder and have time machine back up that folder.

Resources