Vietnamen’s Weblog

Time, Chances, Diligence, Intelligence: which is the most important?

Virtualbox

leave a comment »

Install Virtuabox OSE

To increase speed in networking with shared-folders from host OS, follow these below steps.

Setup host-only networking

http://www.giannistsakiris.com/index.php/2007/11/01/host-only-networking-for-virtualbox/

The below is the summary of the content in the above link

sudo apt-get install uml-utilities         # install the uml-utilities package:
sudo tunctl -t tap0 -u <username> # create the virtual network interface that the two operating systems will share:
sudo ifconfig tap0 10.0.1.1 # assign the IP 10.0.1.1 to the Host system (Linux):
sudo chgrp vboxusers /dev/net/tun          # make sure that VirtualBox has full access to /dev/net/tun:
sudo chmod 0666 /dev/net/tun
sudo gedit /etc/group # add all users of VirtualBox in the vboxusers group (add nobody user if it doesnot work): going to System → Administration → User and Groups

Now start VirtualBox and before you boot your Windows XP, highlight your virtual machine and click on Settings. Go to Network. Find a free network adapter. Enable it and select Attached to: Host Interface. At the Host Interface Settings section go to Interface Name and type in the interface’s name, that is, tap0. Click Ok and boot your Windows XP.

When Windows is started, go to Start → Settings → Network Connections. Find the connection you previously added and open its Properties window. Highlight Internet Protocol (TCP/IP) and click Properties. Check the Use the following IP address option. In IP address enter 10.0.1.2. In Subnet mask enter 255.255.255.0. Leave Default gateway empty. It should look like this:

snap of windows xp internet protocol properties

Note that you will have to disable firewall for that network interface in Windows XP in order for ping to work. From Guest (Windows XP) use the IP 10.0.1.1 to ping the Host (Ubuntu):
Although all settings applied to the network interface in Windows will be available every time you boot Windows, the virtual network interface will go away next time you shut down your Linux system. One easy solution to this, is to add the commands that set up your network interface in your /etc/rc.local script:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

echo “Setting up tap0 interface…”
tunctl -t tap0 -u <username>
ifconfig tap0 10.0.1.1

exit 0

Now the tap0 interface will be available every time you boot your Ubuntu system. Note that you do not have to use sudo inside /etc/rc.local as this script is executed by root anyway.

Setup writeable shared folder with samba on ubuntu

http://www.giannistsakiris.com/index.php/2007/09/22/writeable-shared-folder-with-samba-on-ubuntu/

First, add the folder you want to share in your Shared Folder list. That is System Administration Shared Folders (if this menu item is missing, pres Alt-F2 and run “shares-admin“). You may need to click on the Unlock button and enter your password. Click the Add button. On the opening dialog, choose the path of the folder and the name by which the folder will be exposed. Make sure that you selected Share through: Windows networks (SMB) and that you unchecked the Readonly checkbox. Click Ok and close the Shared Folders dialog.

Now, edit the /etc/samba/smb.conf file as root to change the authentication method:

sudo gedit /etc/samba/smb.conf

Go to the Authentication section and uncomment the security=user line. (You uncomment the line by removing the preceding semicolon). Make it look like this:

####### Authentication #######

# “security = user” is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
security = user

# You may wish to use password encryption. See the section on
# ‘encrypt passwords’ in the smb.conf(5) manpage before enabling.
encrypt passwords = true

Now, you have to setup a password for the user that will have remote access to your shared foders. Run this command:

# smbpasswd your-username
New SMB password: *******
Retype new SMB password: *******
#

access to shared folders on VirtualBox

http://www.giannistsakiris.com/index.php/2007/11/01/faster-access-to-shared-folders-on-virtualbox/

When your shared folder is all done you can switch to your Windows XP and access it. Go to Start → Run and type \\10.0.1.1\xfer and click Ok:

windows xp run command dialog

Your shared folder should open with no serious delays and browsing should be quite responsive

Resize a Virtual Box disk image

Download Clonezilla: http://www.clonezilla.org/

And follows the steps in here: http://virtualdebian.blogspot.com/2008/03/how-to-resize-virtualbox-virtual-disk.html

Here is the copy from the above link:

  1. Create a bigger dynamic virtual disk from VirtualBox Disk Manager
  2. Download Clonezilla
  3. Set up your virtual machine (VM) to mount Clonezilla ISO disk image and boot from it.
  4. Add the new bigger virtual disk image as the VM’s primary slave hard disk
  5. Boot Clonezilla and choose the disk-to-disk cloning mode
  6. Deselect the option “Resintall Grub bootloader” if you want to preserve Linux Mint styled bootloader.
  7. When the cloning is done, shutdown the VM.
  8. Set up the VM to boot from a Linux Mint ISO image (if you have it) or from Linux Mint live CD, Gparted live CD, or any ISO image or live CD which includes Gparted.
  9. Unselect the use of the VM’s primary slave hard disk and set the bigger virtual disk (which now contains the clone) as the primary master disk.
  10. Boot the live CD you chose and start Gparted (it’s called Partition tool in Linux Mint).
  11. If Gparted shows a swap partition it must be moved all the way to the right (together with the extended partition it is on) before you are able to resize the root partition. First you have to enlarge the extended partition, then the swap, preserving their sizes. But before you can do that you must click the swap partition and click the option “swapoff”. Gparted will close, that’s OK, just run it again.
  12. When you have your partitions as you like, apply the changes and shut down the VM.
  13. Set up the VM to mount from the primary master disk and eventually remove your old primary master disk from the Virtual Disk Manager.

Written by vietnamen

Tháng Hai 25, 2009 lúc 9:32 chiều

Posted in Linh tinh

Gửi phản hồi

Mời bạn điền thông tin vào ô dưới đây hoặc kích vào một biểu tượng để đăng nhập:

WordPress.com Logo

Bạn đang bình luận bằng tài khoản WordPress.com Log Out / Thay đổi )

Twitter picture

Bạn đang bình luận bằng tài khoản Twitter Log Out / Thay đổi )

Facebook photo

Bạn đang bình luận bằng tài khoản Facebook Log Out / Thay đổi )

Google+ photo

Bạn đang bình luận bằng tài khoản Google+ Log Out / Thay đổi )

Connecting to %s

%d bloggers like this: