AdminTalk - Talk to Learn

Navigation
Go Back   AdminTalk - Talk to Learn > Server Operating System > Linux Server
Linux Server Cài đặt, bảo mật, kinh nghiệm quản trị máy chủ Linux: CentOS, OpenSuSe, RedHat, Debian ...

Đề mục chính

Cấu trúc diễn đàn
Thông tin tổng hợp
Thông báo và quy định chung
Đóng góp ý kiến
Những bài viết có giá trị
Tin tức công nghệ
•• Tin tức công nghệ thông tin
•• Doanh Nghiệp & Người Tiêu Dùng
Premium Server, Hosting Support
Web Hosting / Domain
•• Kiến thức cơ bản về Web Hosting/Domain
•• Plesk - CPanel
Server / VPS
•• Kiến thức cơ bản Server - VPS
•• Server Review/ Hardware
•• Mail Server - AntiSPAM
Virtuozzo - VMWare - HyperV
•• For Windows
•• For Linux
Security
•• Mạng Wan - Lan
•• Internet - Virus - Hacker
VoIP
•• Kiến Thức Cơ Bản VoIP
•• Phần Cứng VoIP
•• Phần Mềm VoIP
•• Nhà cung cấp VoIP
Server Operating System
Linux Server
Windows Server 200x
Computer Supports and Discussion
Operating System
•• Hệ điều hành Linux
•• Hệ điều hành Windows
•• Hệ điều hành Mac
•• Hệ điều hành Chrome
Laptop, Netbook
Hardware
•• Cpu Intel
•• Cpu AMD
•• PSU, Overclocking & Cooling
•• Mainboard & Memory
•• Đồ họa máy tính
•• Kinh nghiệm
Software
•• Linux Apps
•• Windows Apps
Webmaster Area
Webmaster talk
Programming Language
•• HTML & CSS
•• PHP
•• C++ / C#
•• .NET
•• Java
•• Other
Graphic & Mutimedia
SEO (Search Engine Optimization)
Browsers
•• Mozilla Firefox
•• Chrome
•• Internet Explorer
Thủ Thuật Internet
Thương mại điện tử
•• Hình thức thanh toán
•• Giải pháp
HiTech, Mobile, Movies, Music, eBooks, Relax
Tablet PC
•• iPad
Mobile
•• iPhone
•• BlackBerry
•• Others
Movies
•• Download phim HD
•• Download phim DVD
Music
•• Download nhạc Lossless Album
•• Download nhạc Lossless tuyển chọn
eBooks - Tài liệu
•• Tin học - Lập trình
•• Khoa học - Kỹ thuật
•• Ngoại Ngữ
•• Tutorials - Training
•• Kinh tế
•• Thể Loại Khác
Bài học trong cuộc sống
AdminTalk – Talk to You
Introduce Youself
Off topic/ Chatting
Mua bán - Rao vặt - Tuyển dụng
Quảng cáo
Tuyển dụng

Bầu chọn mới nhất
Bạn nghĩ sao về công nghệ USB 3.0 ?

Rất tuyệt! Sẽ sử dụng ngay nếu được bán trên thị trường: 47.37%

Tốt hơn USB 2.0 , nhưng giá có thể mắc hơn nhiều: 42.11%

Bình thường thôi, công nghệ luôn thay đổi mà: 10.53%

Không quan tâm lắm: 0%
Voters: 38. You may not vote on this poll

Thống kê
Đề tài: 10641
Bài gửi: 12205
Thành viên: 20,207
Thành viên tích cực: 81
Xin cùng nhau chào đón thành viên mới nhất: buixuantu
Kỷ lục: 624 người đã ghé thăm 17/11/2010 lúc 06:16 AM.
Thành viên mới:
Hôm qua
- buixuantu
Hôm qua
- baophuc0711
08/02/2012
- ddvtien
08/02/2012
- thanhtam1028
08/02/2012
- goodhealthvn1
08/02/2012
- honghobao286
07/02/2012
- condau
07/02/2012
- timlaibautroi7408
07/02/2012
- NguyenLien
07/02/2012
- quydona

Số người đang xem
View Who's Online Thành viên: 1
Khách: 131
Tổng: 132
Nhóm: 0
Nhóm:  
Thành viên:  aviovn8
Mở Sổ Bạn Bè

Trả lời
 
LinkBack Ðiều Chỉnh Kiếm Trong Bài Xếp Bài

  #1 (permalink)
Old 19/04/2010, 11:19 AM
[OpenSUSE] - Running Virtual Machines With VirtualBox 3.1.x

shomenuchi
Admintalk's SMod
love talking
 
Tham gia ngày: Mar 2010
Bài gởi: 199
My Mood:
Thanks: 0
Thanked 4 Times in 4 Posts
VP: 1.00
Donate
This guide explains how you can run virtual machines with Sun VirtualBox 3.1.x on a headless OpenSUSE 11.2 server. Normally you use the VirtualBox GUI to manage your virtual machines, but a server does not have a desktop environment. Fortunately, VirtualBox comes with a tool called VBoxHeadless that allows you to connect to the virtual machines over a remote desktop connection, so there's no need for the VirtualBox GUI.

I do not issue any guarantee that this will work for you!

1 Preliminary Note

I have tested this on an OpenSUSE 11.2 server (host system) with the IP address 192.168.0.100 where I'm logged in as a normal user (user name admin in this example) instead of as root.

If you only have a root account, but no normal user account, create one as follows (user admin, group admin)...

Code:
# groupadd admin
# useradd -d /home/admin -m -g admin -s /bin/bash admin
... create a password for the new user...

Code:
# passwd admin
... and log in as that user.

2 Installing VirtualBox

To install VirtualBox 3.1.x on our OpenSUSE 11.2 server, we need root privileges, therefore we run

Code:
$ su
First we have to find out what kernel we have installed:
Code:
# uname -a
server1:/home/admin # uname -a
Linux server1 2.6.31.5-0.1-desktop #1 SMP PREEMPT 2009-10-26 15:49:03 +0100 x86_64 x86_64 x86_64 GNU/Linux
server1:/home/admin #

As you see I have the kernel-desktop package installed - if you have the kernel-server package installed, replace desktop with server in the following command.

We install the dependencies for VirtualBox 3.1.x as follows (by installing the kernel-desktop/kernel-server package again, we make sure that we have the latest version installed):

Code:
# yast -i kernel-desktop kernel-desktop-devel kernel-source kernel-syms Xerces-c gcc make
If the kernel gets updated, YaST will tell you that you must reboot the system - in this case run:

Code:
# reboot
Log in as the normal user again and then become root:

Code:
$ su
Next download and register Sun's public rpm key:

Code:
# wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | rpm --import -
Now we enable the VirtualBox OpenSUSE repository on our system:

Code:
# cd /etc/zypp/repos.d/
# wget http://download.virtualbox.org/virtualbox/rpm/opensuse/11.2/virtualbox.repo
We can now simply install VirtualBox 3.1.x as follows:
Code:
# yast -i VirtualBox-3.1
Afterwards make sure that the vboxdrv kernel module is loaded:
Code:
# modprobe vboxdrv
The following command makes sure that the vboxdrv kernel module gets loaded automatically whenever you boot the system:

Code:
# insserv vboxdrv
Now we must add the user that will run VirtualBox (admin in this example) to the vboxusers group:

Code:
# /usr/sbin/usermod -G vboxusers admin
VirtualBox is now installed and ready to be used.

Type
Code:
# exit
to leave the root account and become a normal user (admin) again.

3 Using VirtualBox On The Command Line

3.1 Creating A VM

To create a VM on the command line, we can use the VBoxManage command. See

Code:
$ VBoxManage --help
for a list of available switches and (highly recommended!) take a look at
Code:
http://www.virtualbox.org/manual/UserManual.html#vboxmanage.
I will now create an Ubuntu 9.10 Server VM with 256MB memory and a 10GB hard drive from the Ubuntu 9.10 Server iso image (which I have stored in /home/ubuntu-9.10-server-amd64.iso):

Code:
$ VBoxManage createvm --name "Ubuntu 9.10 Server" --register
$ VBoxManage modifyvm "Ubuntu 9.10 Server" --memory 256 --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 eth0
$ VBoxManage createhd --filename Ubuntu_9_10_Server.vdi --size 10000 --register
$ VBoxManage storagectl "Ubuntu 9.10 Server" --name "IDE Controller" --add ide
$ VBoxManage storageattach "Ubuntu 9.10 Server" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium Ubuntu_9_10_Server.vdi
$ VBoxManage storageattach "Ubuntu 9.10 Server" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium /home/ubuntu-9.10-server-amd64.iso
3.2 Importing An Existing VM

Let's assume you have a VM called examplevm that you want to reuse on this host. On the old host, you should have a directory Machines/examplevm in the VirtualBox directory; Machines/examplevm should contain the examplevm.xml file. Copy the examplevm directory (including the examplevm.xml file) to your new Machines directory (if your user name is admin, this is /home/admin/.VirtualBox/Machines - the result should be /home/admin/.VirtualBox/Machines/examplevm/examplevm.xml).

In addition to that copy the examplevm.vdi file from the old VDI directory to the new one (e.g. /home/admin/.VirtualBox/VDI/examplevm.vdi).

Afterwards, you must register the imported VM:

Code:
$ VBoxManage registervm Machines/examplevm/examplevm.xml
3.3 Starting A VM With VBoxHeadless

Regardless of if you create a new VM or import and old one, you can start it with the command:

Code:
$ VBoxHeadless --startvm "Ubuntu 9.10 Server"
(Replace Ubuntu 9.10 Server with the name of your VM.)

VBoxHeadless will start the VM and a VRDP (VirtualBox Remote Desktop Protocol) server which allows you to see the VM's output remotely on another machine.

To stop a VM, run

Code:
$ VBoxManage controlvm "Ubuntu 9.10 Server" poweroff
To pause a VM, run
Code:
$ VBoxManage controlvm "Ubuntu 9.10 Server" pause
To reset a VM, run
Code:
$ VBoxManage controlvm "Ubuntu 9.10 Server" reset
To learn more about VBoxHeadless, take a look at

Code:
$ VBoxHeadless --help
and at

Code:
http://www.virtualbox.org/manual/UserManual.html.
(Theo unix-tutorials)

Bài viết cùng chủ đề:
shomenuchi vẫn chưa có mặt trong diễn đàn  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Trả Lời Với Trích Dẫn
Trả lời

Bookmarks

Tags
machines, opensuse, server, virtual, virtualbox


Ðang đọc: 1 (0 thành viên và 1 khách)
 
Ðiều Chỉnh Kiếm Trong Bài
Kiếm Trong Bài:

Kiếm Chi Tiết
Xếp Bài

Quyền Sử Dụng Ở Diễn Ðàn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Smilies đang Mở
[IMG] đang Mở
HTML đang Tắt
Trackbacks are Mở
Pingbacks are Mở
Refbacks are Mở

Chuyển đến



Múi giờ GMT. Hiện tại là 07:06 AM.
Powered by: vBulletin - Copyright © 2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.AdminTalk.vn
Powered by vBCMS® 1.2.5 ©2002 - 2012 VinaCIS® Corporation