Announcement

Collapse
No announcement yet.

virtualbox installing win7 from usb using a .vmdk file & running VB as root from menu

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    virtualbox installing win7 from usb using a .vmdk file & running VB as root from menu

    I am using kubuntu 14.04

    I have installed VirtualBox (VB) from Ubuntu Software Centre.

    I have an iso of Win7 on a USB stick.

    To get VB to boot from the USB I have created a .vmdk file to enable the USB stick to be used as a boot disk.

    If I start VB from a terminal as root I can use that file and the boot takes place normally followed by Win7 install.

    Problem: If I close the terminal window or shutdown the Virtual Machine (VM), the VM is lost and I must start again from the beginning.

    If I start VB as a normal user then I am unable to use the .vmdk file as I get the error:

    "Failed to open the hard disk file /home/makem/my_usb_stick.vmdk. Permission problem accessing the file for the medium '/home/makem/my_usb_stick.vmdk' (VERR_ACCESS_DENIED)."

    This is because this can only be done as root.

    I have tried changing the owner and permissions to 777 of the .vmdk file but still get the same error

    Solution: Start VB as root from the kubuntu menu system.

    However, I cannot find any way to do this. Help appreciated.

    Edit: I have since tried editing the launcher for VB from Exec=VirtualBox %U to Exec=sudo -k -u root VirtualBox %U

    VB does not start up at all.

    #2
    Don't use sudo with vb, it is 100% not necessary. You'll also have to change ownership of the file, not just permissions

    sudo chown -R your-username:your-username /home/your-username/folder-with-vb-files

    This will put all the virtual machine files back to being owned by you (there are more than vmdk files in there that need adjusting), and vb should run fine without using sudo.

    Sent from my LG G4

    Comment


      #3
      Originally posted by claydoh View Post
      Don't use sudo with vb, it is 100% not necessary. You'll also have to change ownership of the file, not just permissions

      sudo chown -R your-username:your-username /home/your-username/folder-with-vb-files

      This will put all the virtual machine files back to being owned by you (there are more than vmdk files in there that need adjusting), and vb should run fine without using sudo.

      Sent from my LG G4
      I have not yet made a Virtual Machine so don't have and VMfiles in my /home.

      The file I refer to (.vmdk) is one I made to connect the USB port to VB. But it must be 'attached' as a drive and to do that with that file VB must be root.

      That is why I ask how to run VB as root to enable me to 'attach' the drive. Even with the file being my file with full permissions it still does not work. I have a vague idea (related to groups), why not maybe but I want to pursue the suggestion below first.

      However, having done more research It may be that I should install an extension package which I hope will allow access to USB and so circumvent what appears may be an old method.

      Thanks for the input.

      Comment


        #4
        You do not need to run vb as root for any reason. You don't even need to do anything to attach the iso file to the virtual machine - you can point it to the iso file itself. Go through the wizard to create the windows 7 virtual machine, and when that is finished, look for the Storage section of the machine's settings.

        Click image for larger version

Name:	snapshot3.jpg
Views:	1
Size:	51.5 KB
ID:	643052

        You can see above where to go. You just need to point it to the iso file, you don't use a vmdk or anything at all, just the iso file. When the VM 'boots' it will do so from the iso as if it were a disk in an optical drive. When finished, you can use the "remove disk from virtual drive" option.

        You will still need to fix ownership on any files that were created by or used by virtualbox when run with sudo, such as configuration settings and the like, so you may want to run the command like so;

        sudo chown -R your-username:your-username /home/your-username
        this will make sure any and all files with ownership changed by running any gui program with sudo are set back to what they should be.


        If you must run a gui program with admin privileges - and this would be limited to your file manager and text editor ONLY - use kdesudo instead of sudo. Anything else that needs elevated privileges will ask you for your password when it is needed.

        Comment


          #5
          Originally posted by makem View Post

          I have an iso of Win7 on a USB stick.
          I am sorry, I started with an iso on usb but I believe it is not bootable - probably corrupt or something and am waiting to be able to create a new iso. The current iso will not boot from the usb or linux.

          Whilst waiting I used a bootable usb stick of win7 and it is this I am trying to use at the moment.

          I know you are correct about using the iso simply but cannot yet.

          I meant to have said, "I have a bootable copy of win7 on a usb stick"

          Best I think to wait until I buy a usb dvd drive in which I can put my win7 dvd and make a iso

          Comment


            #6
            Bought a usb dvd drive today, didn't work so got refund. Will usea friends computer to make iso and see if I can do as you suggest.

            This is getting to be quite a saga

            Comment


              #7
              Since you have not specified the source of your win 7 install media (brand/model-specific recovery disk? official MS install disk?), here is an alternative:

              http://www.howtogeek.com/186775/how-...media-legally/
              Last edited by claydoh; Oct 09, 2015, 03:19 PM.

              Comment


                #8
                Originally posted by claydoh View Post
                Since you have not specified the source of your win 7 install media (brand/model-specific recovery disk? official MS install disk?), here is an alternative:

                http://www.howtogeek.com/186775/how-...media-legally/
                Thank you, however, I did try that site and found they do not have an English language version of win7.

                I have a copy I bought of both win7 pro 32 and 64 bit. The 32 is damaged but I have a working backup I made on day 1. It is from that I was trying to make a bootable iso. A friend will bring his DVD today and w will attempt to make another iso on another friends machine! (few people seem to have dvd readers)

                I have downloaded a copy of the Chinese version of win7 as a check that we are making a bootable copy when we try today. My wife is Chinese so maybe I can change the language anyway.

                Comment


                  #9
                  Can't change the language Can't make bootable iso.

                  Comment


                    #10
                    I am still unable to make a win7 iso because of lack of a dvd drive and a usb install fails.

                    I have downloaded an iso of win10 pro which is what was installed on my machine before I updated it to win 10. Now I have a win 10/kubuntu dul boot system.

                    On another 32 bit machine I downloaded the win 10 iso from microsoft web site but that also fails to install although it does boot.

                    It fails when I enter the sticker number which is on a spare bought copy of win 7 pro and also fails when I use the number from this machine.

                    If I skip the number it continues but says it can't find a hard disk and offers to load a driver which it also cannot find so there ends the install.

                    I am wondering if it fails because it cannot check via the internet?

                    I think I will post a separate request as the heading for this one is now incorrect.

                    Comment

                    Working...
                    X