Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15314146
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类: LINUX

2008-09-23 21:06:56

ubuntu8下编译安装vmware-server-distrib步骤

//========================================================================
luther@gliethttp:~/vmware-server-distrib$ sudo vmware-config.pl
//错误提示:
    ......
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmmon-only'
make -C /lib/modules/2.6.24-19-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.24-19-generic'
  CC [M]  /tmp/vmware-config0/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config0/vmmon-only/./include/vmware.h:25,
                 from /tmp/vmware-config0/vmmon-only/linux/driver.c:48:
/tmp/vmware-config0/vmmon-only/./include/vm_basic_types.h:161: error: conflicting types for ‘uintptr_t’
include/linux/types.h:40: error: previous declaration of ‘uintptr_t’ was here
In file included from /tmp/vmware-config0/vmmon-only/linux/driver.h:20,
                 from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/compat_wait.h:37:5: warning: "VMW_HAVE_EPOLL" is not defined
/tmp/vmware-config0/vmmon-only/./include/compat_wait.h:43:5: warning: "VMW_HAVE_EPOLL" is not defined
In file included from /tmp/vmware-config0/vmmon-only/linux/driver.h:20,
                 from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/compat_wait.h:60: error: conflicting types for ‘poll_initwait’
include/linux/poll.h:65: error: previous declaration of ‘poll_initwait’ was here
/tmp/vmware-config0/vmmon-only/linux/driver.c:147: warning: initialization from incompatible pointer type
/tmp/vmware-config0/vmmon-only/linux/driver.c:151: warning: initialization from incompatible pointer type
/tmp/vmware-config0/vmmon-only/linux/driver.c: In function ‘LinuxDriver_Ioctl’:
/tmp/vmware-config0/vmmon-only/linux/driver.c:1659: error: ‘struct mm_struct’ has no member named ‘dumpable’
make[2]: *** [/tmp/vmware-config0/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-19-generic'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config0/vmmon-only'
Unable to build the vmmon module.

For more information on how to troubleshoot module-related problems, please
visit our Web site at "" and
"".

Execution aborted.
//========================================================================
//可以直接下载vmware-server-1.07
//luther@gliethttp:~$ wget
//解决方法:
<1> luther@gliethttp:~$ wget
//对于2.6.25内核的fedora9需要下载117补丁
//wget
//分给xp-128M内存,没办法v3162au只有512M内存,所以绝对不能让虚拟机影响到我的fedora9主系统.
<2> luther@gliethttp:~$ tar zxvf vmware-any-any-update-116.tgz
<3> luther@gliethttp:~/vmware-any-any-update116$ sudo ./runme.pl
//对于2.6.25内核的fedora9到这里就已经ok了,直接启动vmware就可以了,不需要下面的2步
<4> luther@gliethttp:~$ sudo ln -sf /lib/libgcc_s.so.1 /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1
<5> luther@gliethttp:~$ sudo ln -sf  /usr/lib/libpng12.so.0 /usr/lib/vmware/lib/libpng12.so.0/libpng12.so.0
<6> luther@gliethttp:~$ vmware      //就可以正常运行了.
<7> luther@gliethttp:~$ wget 这样可以从vmware的windows下方便访问ubuntu.

ps:如果是64位系统:
sudo ln -s /usr/lib32 /usr/l32
sudo sed -i -e 's/usr\/lib/usr\/l32/g' /usr/lib32/gtk-2.0/2.10.0/loader-files.d/libgtk2.0-0.loaders
sudo sed -i -e 's/usr\/lib/usr\/l32/g' /usr/lib32/libgdk_pixbuf-2.0.so.0.1200.9

参考文档:



//========================================================================
//配置usb自识别功能
1. 关闭vmware
2. 在.vmx文件结尾追加:usb.generic.skipSetConfig = "TRUE"
3. sudo vim /etc/init.d/mountdevsubfs.sh
   去掉#注释,使能如下四行:
       mkdir -p /dev/bus/usb/.usbfs
    domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
    ln -s .usbfs/devices /dev/bus/usb/devices
    mount --rbind /dev/bus/usb /proc/bus/usb
4. 重启mountdevsubfs.sh
   sudo /etc/init.d/mountdevsubfs.sh start
5. 重启vmware的服务
   sudo /etc/init.d/vmware* restart
6. VM=>Settings=>Hardware=>Add添加一个USB Controller,或者直接按ctrl+D进入Settings.
7. vmware打开已经安装的winxp系统.
8. 进入winxp之后,插入u盘到ubuntu上,这时winxp下还不能显示出来u盘,还需要做一个操作才可以.
9. VM=>Removable Devices=>USB Devices会出现所有插入主机usb总线上的usb设备,然后点击u盘设备,winxp就可以识别出u盘了[luther.gliethttp].
//========================================================================
//启动samba文件共享,实现guest的winxp和host的ubuntu的网络共享
<0> luther@gliethttp:~$ sudo apt-get install samba smbfs
<1> luther@gliethttp:~$ sudo groupadd sandbox
<2> luther@gliethttp:~$ sudo useradd --gid sandbox --shell /bin/false sandbox
<3> luther@gliethttp:~$ sudo smbpasswd -a sandbox
<4> luther@gliethttp:~$ sudo mkdir /home/sandbox
<5> 2luther@gliethttp:~$ sudo chown luther:sandbox /home/sandbox
<6> luther@gliethttp:~$ sudo chmod 775 /home/sandbox
<7> luther@gliethttp:~$ sudo chmod g+s /home/sandbox
<8> luther@gliethttp:~$ sudo vim /etc/samba/smb.conf
设置samba共享文件,追加如下内容:
[luther_sandbox]
path = /home/sandbox
available = yes
browsable = yes
public = yes
writable = yes
<9> luther@gliethttp:~$ sudo /etc/init.d/samba restart
//在fedora9下使用sudo service smb restart
然后winxp就可以输入ubuntu这个host的ip地址,来登录共享samba文件夹了.
PS:
smbclient -U sandbox \\\\192.168.0.101\\luther_sandbox 使用用户名sandbox访问luther_sandbox共享文件夹
smbclient -L 192.168.0.101 列出192.168.0.101地址主机共享的所有文件
sudo mount -o username=luther,iocharset=utf8 //192.168.1.179/windows_share  ~/samba/179 来mount网络文件系统[luther.gliethtp].
//========================================================================
//


VMware Workstation (and presumably the other enterprise-grade products in the VMware family) come with the handy “shared folders” feature which makes sharing files between a host and a virtual appliance nice and simple. The free products (VMware Player and Server) do not, unfortunately, have this ability and so we must find another way.

This quick guide shows how to use to achieve the same aim. It is aimed at Ubuntu users but (the general concepts at least) should work on any modern Linux distribution. It is also written with a Windows XP guest in mind but a similar process should work in Windows Vista, Windows 2000 and other operating systems.

The goal is to set up a network share which both operating systems can transparently read and write to.

For reference, I am using Ubuntu 7.04 (Feisty).

Which VMware?

I’ll presume you have VMWare already installed with a Windows XP guest virtual appliance already set up. This guide is aimed at users of VMware Player and Server editions (I am using VMware Player).

VMware Player is a simple:

sudo apt-get install vmware-player 

away. For the Server edition, you’ll probably want to .

Install Samba

If you don’t already have Samba installed, now would be a good time to do it:

sudo apt-get install samba

In order to keeps things clean and easy to manage, we’ll set up a new user account to own the share. This account name will be used when connecting to the share from within Windows. For the purposes of illustration, I will be creating a share called sandbox with the username and group also being sandbox.

Create the new group and user account with no login privileges:

sudo groupadd sandbox
sudo useradd --gid sandbox --shell /bin/false sandbox

To avoid creating a redundant home directory, you can add:

--home /nonexistent

to the end of the previous command.

Now you need to add a matching Samba account. You’ll be prompted to set a password - make note of this as this is what you will use to connect to the share from within Windows.

sudo smbpasswd -a sandbox

Next you’ll need to create a directory to be used as the share (assuming you don’t already have one). Create a directory, setting the username to your usual login and group to sandbox. Then chmod the directory 775 (assuming you wish both yourself and the virtual appliance to have read/write access). Here is what I entered:

cd $HOME
mkdir sandbox
sudo chown russ:sandbox sandbox
sudo chmod 775 sandbox

When you write to the share from within Ubuntu, new files will be created with the default permissions 644 with the username and group being your own user account. When your Windows client connects to the share, it will access it as if it were the local system user sandbox and so the group permissions will apply and you won’t be able to write to any files created from within Ubuntu.

To get around this problem, we can set the groupid bit for the sandbox directory which means all new files created will inherit the permissions of the parent and so the sandbox user from within Windows will be able to make read and write changes as desired.

sudo chmod g+s sandbox

If you don’t understand the above, don’t worry, just chmod the directory with the command above and all should be well.

Setting up the Samba share

Now all that’s left to do is to tell Samba about our share. Open up /etc/samba/smb.conf in your favourite text editor.

sudo gedit /etc/samba/smb.conf

Firstly, we need to set the security mechanism to user. Look for the line:

security = user

and make sure it is uncommented (remove the preceding semicolon if there is one).

Now, scroll down to the Share Definitions section and add the following:

[sandbox]
path = /home/russ/sandbox
valid users = sandbox
read only = No
create mask = 0777
directory mask = 0777

Be sure to set the correct path to your share. Save the file and restart the Samba daemon:

sudo /etc/init.d/samba restart

That should be it. You should now be able to connect to your share from within the Windows guest. At this point you need to know what IP address to connect to from within Windows. This depends on what networking mode you are using for your virtual appliance.

Bridged Networking

In this mode, your guest OS has its own IP address and so the address it needs to connect to is your usual host machine’s address. In this case your address is probably the top line from the output of this command:

ifconfig | grep "inet addr:"

NAT networking

In this mode, your guest OS shares your host’s address (in terms of other machines on the LAN) and communicates with the host via a private network. In this case, the IP address you need to connect to is most likely the bottom one from the output of this command:

ifconfig | grep "inet addr:"

Connecting to the share from within Windows

If you are unsure as to your host’s IP address, try and ping it first from within the Windows guest to confirm you have the right one.

Windows Map Networking Drive dialog

Having worked out what IP address to connect to, you should now be able to connect to your share from within Windows.

The easiest way to do this is:

  1. Open up My Computer
  2. Go to the Tools menu and then Map Network Drive
  3. Choose a drive letter to map the network share to
  4. In Folder, enter: \\HOSTIP\sandbox (replacing HOSTIP)
  5. Click “Connect using a different user name” and enter:
    • username: sandbox
    • password: yourpassword
  6. Click OK and then the Finish button to connect

Hopefully, congratulations are in order. If not, be sure to make sure that any firewalls you have running (host or guest) have the correct rules set to allow communication between the two systems.

A note on security

At this point, assuming you have a successful connection, it is worth noting that any other machine on your local network (and potentially the internet if you are not behind a NAT or firewall) can connect to your share (assuming they have the correct credentials).

If you are only using Samba for sharing with VMware (as I am), you may wish to restrict access to VMware only. This is quite easy to do since VMware creates virtual network interfaces for communication between hosts and guests. This means we can set Samba up to ignore any communications that do not originate from these interfaces.

To do this, open up your Samba configuration file again:

sudo gedit /etc/samba/smb.conf

Make sure you have a:

bind interfaces only = true

line and that it is uncommented (remove any preceding semicolons). Just above this should be an interfaces line (most likely commented out). Add the following just below this:

interfaces = vmnet0 vmnet1 vmnet8

These are the virtual interfaces VMware uses for each type of virtual networking: bridged, host only and NAT respectively.

After making the changes, you will need to restart Samba again:

sudo /etc/init.d/samba restart

and possibly shutdown your VMware session and restart the VMware service:

VMware Player:

sudo /etc/init.d/vmware-player restart

VMware Server:

sudo /etc/init.d/vmware restart

Finished

You should now have a Samba share configured which is only accessible from your VMware guest appliances. Good luck!

阅读(2849) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~