WO2021169285A1 - 一种向VMWare虚拟机传输文件的方法、装置、设备和介质 - Google Patents

一种向VMWare虚拟机传输文件的方法、装置、设备和介质 Download PDF

Info

Publication number
WO2021169285A1
WO2021169285A1 PCT/CN2020/118344 CN2020118344W WO2021169285A1 WO 2021169285 A1 WO2021169285 A1 WO 2021169285A1 CN 2020118344 W CN2020118344 W CN 2020118344W WO 2021169285 A1 WO2021169285 A1 WO 2021169285A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
file
vmware virtual
vmware
interface
Prior art date
Application number
PCT/CN2020/118344
Other languages
English (en)
French (fr)
Inventor
朱波
王旭东
Original Assignee
苏州浪潮智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Publication of WO2021169285A1 publication Critical patent/WO2021169285A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45587Isolation or security of virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Definitions

  • the present invention relates to the field of computer technology, and more specifically, to a method, device, equipment and medium for transferring files to a VMWare virtual machine.
  • Method 1 The user installs the third-party software supporting FTP and HTTP in the virtual machine, and uses the access client provided by the third-party software. The file is transferred to the virtual machine. This solution needs to be completely operated by the user, and the operation steps are more troublesome; Method 2. If the user virtual machine is a Linux system, generally use software like XShell to upload the file through the SSH protocol To the virtual machine; for windows, it is generally through the file sharing protocol SMB/CIFS or through the windows RDB protocol remote desktop to copy files; in either of these two methods, the user is required to install the virtual machine. After the computer is installed, download the third-party software and manually configure some configurations in the virtual machine. Method 3.
  • the program provides an HTTP access interface to the outside world.
  • the program receives external files and converts them into a file stream to be written to the local disk of the virtual machine. This method is for the guest virtual machine. The invasiveness is higher.
  • the purpose of the embodiments of the present invention is to provide a design solution for transferring files to the VMWare virtual machine through the VNC console by extending NOVNC and its websockify agent program.
  • one aspect of the present invention provides a method for transferring files to a VMWare virtual machine, the method including:
  • NOVNC Create a file upload node on the display interface of the NOVNC, and NOVNC transfers the file to be transferred to the agent program in the form of the file stream through the file upload node;
  • the agent program is enabled to transfer the file to the VMWare virtual machine in the form of a file stream through the second HTTP REST interface and the first HTTP REST interface.
  • creating a first HTTP REST interface for the VMWare virtual machine for writing external files to the VMWare virtual machine further includes:
  • the first HTTP REST interface calls the SDK interface provided by the VMWare virtual machine to implement writing the external file into the VMWare virtual machine.
  • the agent program of NOVNC is websockify.
  • the method further includes:
  • the agent is made to transfer the file to the file stream via the second HTTP REST interface and the first HTTP REST interface.
  • the VMWare virtual machine also includes:
  • the agent program calls the first HTTP REST interface to transfer the file to the file writing node of VMWare Tools, and the file writing node writes the file to the VMWare virtual machine in a stream.
  • an apparatus for transferring files to a VMWare virtual machine including:
  • a write interface module where the write interface module is configured to create a first HTTP REST interface for the VMWare virtual machine for writing external files to the VMWare virtual machine;
  • An interface calling module where the interface calling module is configured to encapsulate a second HTTP REST interface for a NOVNC agent program, and the second HTTP REST interface calls the first HTTP REST interface for file stream transmission;
  • a file upload module configured to create an upload file node on the NOVNC display interface, and NOVNC transfers the file to be transferred to the agent program in the file stream through the upload file node;
  • a file transfer module configured to enable the agent program to transfer the file to the VMWare virtual machine in a file stream mode through the second HTTP REST interface and the first HTTP REST interface.
  • the writing interface module is further configured as:
  • the first HTTP REST interface calls the SDK interface provided by the VMWare virtual machine to implement writing the external file into the VMWare virtual machine.
  • the device further includes:
  • a tool installation module configured to install VMWare Tools in the VMWare virtual machine, and create the first HTTP REST interface for the VMWare virtual machine through a file writing node in the VMWare Tools.
  • a computer device which includes:
  • At least one processor At least one processor
  • the memory stores a computer program that can run on the processor, and the processor executes the aforementioned method of transferring files to the VMWare virtual machine when the processor executes the program.
  • a computer-readable storage medium stores a computer program, which is characterized in that, when the computer program is executed by a processor, the aforementioned file transfer to the VMWare virtual machine is executed.
  • the present invention has at least the following beneficial technical effects: the present invention can be achieved without installing a third-party agent program in the virtual machine or installing third-party software by the user, and without any intrusion into the virtual machine. File transfer in VMWare virtual machine.
  • Fig. 1 shows a schematic block diagram of an embodiment of a method for transferring files to a VMWare virtual machine according to the present invention.
  • Fig. 1 shows a schematic diagram of an embodiment of a method for transferring files to a VMWare virtual machine according to the present invention.
  • the method at least includes the following steps:
  • the specific steps are as follows: provide a first HTTP REST interface for writing files to write external files into the virtual machine; modify the NOVNC proxy program websockify to encapsulate a second HTTP REST interface, the interface Call the first HTTP REST interface above to transfer the file stream; modify NOVNC (VNC WEB client) to provide a button for uploading files on the display interface.
  • NOVNC will call the NOVNC proxy websockify, pass the file to the proxy program websockify in the form of a file stream, and websockify will then call the first HTTP REST interface provided, and the file stream will then be injected through the SDK provided by VMWare to inject the file
  • the interface writes files to the VMWare virtual machine in a stream.
  • creating a first HTTP REST interface for the VMWare virtual machine for writing external files to the VMWare virtual machine further includes:
  • the first HTTP REST interface calls the SDK interface provided by the VMWare virtual machine to write external files into the VMWare virtual machine.
  • the SDK interface is officially provided by VMWare, and is used to write external files into the virtual machine.
  • the agent program of NOVNC is websockify.
  • NOVNC is our VNC WEB client based on HTML5, implemented by HTML5 WebSockets, Canvas and JavaScript.
  • NOVNC is currently widely used in the virtual machine consoles of major cloud computing vendors. To access the UI. NOVNC uses WebSockets to implement, but most of the current VNC servers do not support WebSockets, so NOVNC cannot directly connect to the VNC server. It will use its proxy program websockify to convert between WebSockets and TCP sockets.
  • the method further includes:
  • VMWARE tools are enhancement tools that come with the virtual machine, including: device drivers in the virtual machine, folder sharing between the real machine and the virtual machine, and some plug-ins for development functions, etc. . Therefore, in some embodiments of the present invention, some function development and the like are performed by installing VMWare Tools in the VMWare virtual machine.
  • enabling the agent program to transfer the file to the VMWare virtual machine in the form of a file stream through the second HTTP REST interface and the first HTTP REST interface further includes:
  • the agent program calls the first HTTP REST interface to transfer the file to the file writing node of VMWare Tools, and the file writing node writes the file to the VMWare virtual machine in a stream.
  • VMWare Tools includes a file writing node. Through the file writing node, an HTTP REST interface (the first HTTP REST interface) for writing files can be provided. Streaming is written to the VMWare virtual machine.
  • HTTP REST interface the first HTTP REST interface
  • an embodiment of an apparatus for transferring files to a VMWare virtual machine includes:
  • the write interface module is configured to create a first HTTP REST interface for the VMWare virtual machine for writing external files to the VMWare virtual machine;
  • Interface calling module the interface calling module is configured to encapsulate the second HTTP REST interface for the NOVNC agent program, and the second HTTP REST interface calls the first HTTP REST interface for file stream transmission;
  • Upload file module is configured to create an upload file node on the display interface of NOVNC, and the NOVNC transfers the file to be transferred to the agent program in the form of a file stream through the upload file node;
  • the file transfer module is configured to enable the agent program to transfer the file to the VMWare virtual machine in the form of a file stream through the second HTTP REST interface and the first HTTP REST interface.
  • the writing interface module is further configured as:
  • the first HTTP REST interface calls the SDK interface provided by the VMWare virtual machine to write external files into the VMWare virtual machine.
  • the apparatus further includes:
  • the tool installation module is configured to install VMWare Tools in the VMWare virtual machine, and create the first HTTP REST interface for the VMWare virtual machine through the file writing node in the VMWare Tools.
  • another aspect of the embodiments of the present invention also provides a computer device, the computer device includes: at least one processor; and a memory, the memory stores a computer program that can run on the processor, and the processor executes The program executes the aforementioned method of transferring files to the VMWare virtual machine.
  • a computer-readable storage medium stores a computer program, characterized in that, when the computer program is executed by the processor, the aforementioned file transfer to the VMWare virtual machine is executed.
  • the program of the method for transferring files to the VMWare virtual machine can be stored in a In a computer readable storage medium, when the program is executed, it may include the procedures of the above-mentioned method embodiments.
  • the storage medium of the program can be a magnetic disk, an optical disc, a read-only memory (ROM) or a random access memory (RAM), etc.
  • the foregoing computer program embodiment can achieve the same or similar effects as any of the foregoing method embodiments corresponding thereto.
  • the method disclosed according to the embodiment of the present invention may also be implemented as a computer program executed by a processor, and the computer program may be stored in a computer-readable storage medium.
  • the computer program executes the above-mentioned functions defined in the method disclosed in the embodiment of the present invention.
  • the above method steps and system units can also be implemented by a controller and a computer-readable storage medium for storing a computer program that enables the controller to implement the above steps or unit functions.
  • non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory Memory.
  • Volatile memory can include random access memory (RAM), which can act as external cache memory.
  • RAM can be obtained in many forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchronous link DRAM (SLDRAM) and direct Rambus RAM (DRRAM).
  • DRAM synchronous RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM Synchronous link DRAM
  • DRRAM direct Rambus RAM
  • the storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.
  • DSP digital signal processors
  • ASIC application-specific integrated circuits
  • FPGA Field Programmable Gate Array
  • a general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine.
  • the processor may also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in combination with a DSP, and/or any other such configuration.
  • the steps of the method or algorithm described in combination with the disclosure herein may be directly included in hardware, a software module executed by a processor, or a combination of the two.
  • the software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
  • An exemplary storage medium is coupled to the processor such that the processor can read information from or write information to the storage medium.
  • the storage medium may be integrated with the processor.
  • the processor and the storage medium may reside in the ASIC.
  • the ASIC can reside in the user terminal.
  • the processor and the storage medium may reside as discrete components in the user terminal.
  • functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted through the computer-readable medium.
  • Computer-readable media include computer storage media and communication media, including any media that facilitates the transfer of a computer program from one location to another location.
  • a storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.
  • the computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices, or may be used to carry or store instructions in the form of Or any other medium that can be accessed by a general-purpose or special-purpose computer or general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium.
  • coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave to send software from a website, server, or other remote source
  • coaxial cable Cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are all included in the definition of media.
  • magnetic disks and optical disks include compact disks (CDs), laser disks, optical disks, digital versatile disks (DVD), floppy disks, and Blu-ray disks. Disks usually reproduce data magnetically, while optical disks use lasers to optically reproduce data. . Combinations of the above content should also be included in the scope of computer-readable media.
  • the program can be stored in a computer-readable storage medium.
  • the storage medium can be a read-only memory, a magnetic disk or an optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种向VMWare虚拟机传输文件的方法,包括:为VMWare虚拟机创建用于向VMWare虚拟机中写入外部的文件的第一HTTP REST接口;为NOVNC的代理程序封装第二HTTP REST接口,第二HTTP REST接口调用第一HTTP REST接口进行文件流的传输;在NOVNC的展示界面创建上传文件节点,并由NOVNC通过上传文件节点将待传输文件以文件流的方式传递到代理程序;使代理程序通过第二HTTP REST接口以及第一HTTP REST接口将文件以文件流的方式传递到VMWare虚拟机。本发明还公开了一种向VMWare虚拟机传输文件的装置、设备和介质。本发明可以做到在不对虚拟机进行任何侵入的情况下,即可向VMWare虚拟机中传输文件。

Description

一种向VMWare虚拟机传输文件的方法、装置、设备和介质
本申请要求于2020年2月29日提交中国国家知识产权局,申请号为202010132887.5,发明名称为“一种向VMWare虚拟机传输文件的方法、装置、设备和介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机技术领域,更具体地,特别是指一种向VMWare虚拟机传输文件的方法、装置、设备和介质。
背景技术
目前业界中向虚拟机传输文件的方法有很多种:方式1、由用户自己在虚拟机中安装支持FTP、HTTP协议的这种第3方软件,通过第3方软件提供的访问客户端,将文件传输到该虚拟机中,这种方案需要完全由用户自己去操作,操作步骤比较麻烦;方式2、如果用户虚拟机是Linux系统,一般是使用类似XShell这种软件,通过SSH协议将文件上传到虚拟机中;对于windows,一般是通过文件共享协议SMB/CIFS这种或者通过windows的RDB协议远程桌面来拷贝文件;这两种方式中,不论哪一种方式,都需要用户在安装完虚拟机之后,再下载第3方软件,在虚拟机中手动进行一些配置才可以。方式3、写一个程序,放在虚拟机中,该程序对外提供HTTP方式的访问接口,该程序实现接收外面的文件并转化成文 件流写入虚拟机的本地磁盘,这种方式对于客户虚拟机的侵入性较高。
发明内容
有鉴于此,本发明实施例的目的在于提供一种通过对NOVNC以及其websockify代理程序进行扩展实现通过VNC控制台向VMWare虚拟机中传输文件的设计方案。
基于上述目的,本发明一方面提供了一种向VMWare虚拟机传输文件的方法,该方法包括:
为VMWare虚拟机创建用于向所述VMWare虚拟机中写入外部的文件的第一HTTP REST接口;
为NOVNC的代理程序封装第二HTTP REST接口,所述第二HTTP REST接口调用所述第一HTTP REST接口进行文件流的传输;
在所述NOVNC的展示界面创建上传文件节点,并由NOVNC通过所述上传文件节点将待传输文件以所述文件流的方式传递到所述代理程序;
使所述代理程序通过所述第二HTTP REST接口以及所述第一HTTP REST接口将所述文件以文件流的方式传递到所述VMWare虚拟机。
在本发明的向VMWare虚拟机传输文件的方法的一些实施方式中,为VMWare虚拟机创建用于向所述VMWare虚拟机中写入外部的文件的第一HTTP REST接口还包括:
所述第一HTTP REST接口调用所述VMWare虚拟机提供的SDK接口实现向所述VMWare虚拟机中写入所述外部的文件。
在本发明的向VMWare虚拟机传输文件的方法的一些实施方式中, NOVNC的代理程序为websockify。
在本发明的向VMWare虚拟机传输文件的方法的一些实施方式中,方法还包括:
在所述VMWare虚拟机中安装VMWare Tools,通过所述VMWare Tools中的文件写入节点为所述VMWare虚拟机创建所述第一HTTP REST接口。
在本发明的向VMWare虚拟机传输文件的方法的一些实施方式中,使代理程序通过所述第二HTTP REST接口以及所述第一HTTP REST接口将所述文件以文件流的方式传递到所述VMWare虚拟机还包括:
所述代理程序调用所述第一HTTP REST接口,将所述文件传递到VMWare Tools的文件写入节点,并由文件写入节点将文件以流的方式写入到所述VMWare虚拟机中。
本发明实施例的另一方面,还提供了一种向VMWare虚拟机传输文件的装置,该装置包括:
写入接口模块,所述写入接口模块配置为为VMWare虚拟机创建用于向所述VMWare虚拟机中写入外部的文件的第一HTTP REST接口;
接口调用模块,所述接口调用模块配置为为NOVNC的代理程序封装第二HTTP REST接口,所述第二HTTP REST接口调用所述第一HTTP REST接口进行文件流的传输;
上传文件模块,所述上传文件模块配置为在所述NOVNC的展示界面创建上传文件节点,并由NOVNC通过所述上传文件节点将待传输文件以 所述文件流的方式传递到所述代理程序;
文件传递模块,所述文件传递模块配置为使所述代理程序通过所述第二HTTP REST接口以及所述第一HTTP REST接口将所述文件以文件流的方式传递到所述VMWare虚拟机。
在本发明的向VMWare虚拟机传输文件的装置的一些实施方式中,写入接口模块还配置为:
所述第一HTTP REST接口调用所述VMWare虚拟机提供的SDK接口实现向所述VMWare虚拟机中写入所述外部的文件。
在本发明的向VMWare虚拟机传输文件的装置的一些实施方式中,装置还包括:
工具安装模块,所述工具安装模块配置为在所述VMWare虚拟机中安装VMWare Tools,通过所述VMWare Tools中的文件写入节点为所述VMWare虚拟机创建所述第一HTTP REST接口。
本发明实施例的另一方面,还提供了一种计算机设备,该计算机设备包括:
至少一个处理器;以及
存储器,存储器存储有可在处理器上运行的计算机程序,处理器执行程序时执行前述的向VMWare虚拟机传输文件的方法。
本发明实施例的再一方面,还提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,其特征在于,计算机程序被处理器执行时执行前述的向VMWare虚拟机传输文件的方法。
本发明至少具有以下有益技术效果:本发明可以做到无需在虚拟机中安装第3方代理程序或者无需由用户自己安装第3方软件的方式,不对虚拟机进行任何侵入,即可做到向VMWare虚拟机中传输文件。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。
图1示出了根据本发明的向VMWare虚拟机传输文件的方法的实施例的示意性框图。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。
需要说明的是,本发明实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”和“第二”仅为了表述的方便,不应理解为对本发明实施例的限定,后续实施例对此不再一一说明。
基于上述目的,本发明实施例的第一个方面,提出了一种向VMWare虚拟机传输文件的方法的实施例。图1示出的是根据本发明的向VMWare虚拟机传输文件的方法的实施例的示意图。如图1所示的实施例中,该方 法至少包括如下步骤:
S100、为VMWare虚拟机创建用于向VMWare虚拟机中写入外部的文件的第一HTTP REST接口;
S200、为NOVNC的代理程序封装第二HTTP REST接口,第二HTTP REST接口调用第一HTTP REST接口进行文件流的传输;
S300、在NOVNC的展示界面创建上传文件节点,并由NOVNC通过上传文件节点将待传输文件以文件流的方式传递到代理程序;
S400、使代理程序通过第二HTTP REST接口以及第一HTTP REST接口将文件以文件流的方式传递到VMWare虚拟机。
在本发明的一些实施例中,具体步骤如下:提供一个写入文件的第一HTTP REST接口向虚拟机中写入外部的文件;修改NOVNC代理程序websockify,封装一个第二HTTP REST接口,该接口调用上面的第一HTTP REST接口进行文件流的传输;修改NOVNC(VNC WEB客户端),在展示界面上提供一个上传文件的按钮。用户点击上传文件按钮后,NOVNC会调用NOVNC代理websockify,将文件以文件流的方式传递给代理程序websockify,websockify再调用提供的第一HTTP REST接口,将文件流接着通过VMWare提供的注入文件的SDK接口将文件以流的方式写入到VMWare虚拟机中。
根据本发明的向VMWare虚拟机传输文件的方法的一些实施方式,为VMWare虚拟机创建用于向VMWare虚拟机中写入外部的文件的第一HTTP REST接口还包括:
第一HTTP REST接口调用VMWare虚拟机提供的SDK接口实现向VMWare虚拟机中写入外部的文件。
在本发明的一些实施例中,SDK接口是VMWare官方提供的,用于实现向虚拟机中写入外部的文件。
根据本发明的向VMWare虚拟机传输文件的方法的一些实施方式,NOVNC的代理程序为websockify。
在本发明的一些实施例中,NOVNC是我们一种基于HTML5实现的VNC WEB客户端,采用HTML 5 WebSockets、Canvas和JavaScript实现,NOVNC当前已经被普遍用在各大云计算厂商的虚拟机控制台的访问UI。NOVNC采用WebSockets实现,但是目前大多数的VNC服务器都不支持WebSockets,所以NOVNC是不能直接连接VNC服务器的,它会通过它的代理程序websockify来做WebSockets和TCP sockets之间的转换。
根据本发明的向VMWare虚拟机传输文件的方法的一些实施方式,方法还包括:
在VMWare虚拟机中安装VMWare Tools,通过VMWare Tools中的文件写入节点为VMWare虚拟机创建第一HTTP REST接口。
在本发明的一些实施例中,VMWARE tools是虚拟机自带的增强工具,其中包括:虚拟机中的设备驱动、实机与虚拟机之间的文件夹共享、还有一些开发功能的插件等。所以在本发明的一些实施例中,通过在VMWare虚拟机中安装VMWare Tools来进行一些功能的开发等。
根据本发明的向VMWare虚拟机传输文件的方法的一些实施方式,使 代理程序通过第二HTTP REST接口以及第一HTTP REST接口将文件以文件流的方式传递到VMWare虚拟机还包括:
代理程序调用第一HTTP REST接口,将文件传递到VMWare Tools的文件写入节点,并由文件写入节点将文件以流的方式写入到VMWare虚拟机中。
在本发明的一些实施例中,VMWare Tools中包含文件写入节点,通过文件写入节点可以提供一个写入文件的HTTP REST接口(第一HTTP REST接口),通过文件写入节点可以将文件以流的方式写入到VMWare虚拟机中。
本发明实施例的另一方面,提出了一种向VMWare虚拟机传输文件的装置的实施例。该装置包括:
写入接口模块,写入接口模块配置为为VMWare虚拟机创建用于向VMWare虚拟机中写入外部的文件的第一HTTP REST接口;
接口调用模块,接口调用模块配置为为NOVNC的代理程序封装第二HTTP REST接口,第二HTTP REST接口调用第一HTTP REST接口进行文件流的传输;
上传文件模块,上传文件模块配置为在NOVNC的展示界面创建上传文件节点,并由所述NOVNC通过上传文件节点将待传输文件以文件流的方式传递到代理程序;
文件传递模块,文件传递模块配置为使代理程序通过第二HTTP REST接口以及第一HTTP REST接口将文件以文件流的方式传递到VMWare虚 拟机。
根据本发明的向VMWare虚拟机传输文件的装置的一些实施方式,写入接口模块还配置为:
第一HTTP REST接口调用VMWare虚拟机提供的SDK接口实现向VMWare虚拟机中写入外部的文件。
根据本发明的向VMWare虚拟机传输文件的装置的一些实施方式,装置还包括:
工具安装模块,工具安装模块配置为在VMWare虚拟机中安装VMWare Tools,通过VMWare Tools中的文件写入节点为VMWare虚拟机创建第一HTTP REST接口。
基于上述目的,本发明实施例的另一方面,还提出了一种计算机设备,该计算机设备包括:至少一个处理器;以及存储器,存储器存储有可在处理器上运行的计算机程序,处理器执行程序时执行前述的向VMWare虚拟机传输文件的方法。
本发明实施例的再一方面,还提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,其特征在于,计算机程序被处理器执行时执行前述的向VMWare虚拟机传输文件的方法。
同样地,本领域技术人员应当理解,以上针对根据本发明的向VMWare虚拟机传输文件的方法阐述的所有实施方式、特征和优势同样地适用于根据本发明的装置、计算机设备和介质。为了本公开的简洁起见,在此不再重复阐述。
需要特别指出的是,上述向VMWare虚拟机传输文件的方法、装置、设备和介质的各个实施例中的各个步骤均可以相互交叉、替换、增加、删减,因此,这些合理的排列组合变换之于向VMWare虚拟机传输文件的方法、装置、设备和介质也应当属于本发明的保护范围,并且不应将本发明的保护范围局限在实施例之上。
最后需要说明的是,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关硬件来完成,向VMWare虚拟机传输文件的方法的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,程序的存储介质可为磁碟、光盘、只读存储记忆体(ROM)或随机存储记忆体(RAM)等。上述计算机程序的实施例,可以达到与之对应的前述任意方法实施例相同或者相类似的效果。
此外,根据本发明实施例公开的方法还可以被实现为由处理器执行的计算机程序,该计算机程序可以存储在计算机可读存储介质中。在该计算机程序被处理器执行时,执行本发明实施例公开的方法中限定的上述功能。
此外,上述方法步骤以及系统单元也可以利用控制器以及用于存储使得控制器实现上述步骤或单元功能的计算机程序的计算机可读存储介质实现。
此外,应该明白的是,本文的计算机可读存储介质(例如,存储器)可以是易失性存储器或非易失性存储器,或者可以包括易失性存储器和非易失性存储器两者。作为例子而非限制性的,非易失性存储器可以包括只 读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦写可编程ROM(EEPROM)或快闪存储器。易失性存储器可以包括随机存取存储器(RAM),该RAM可以充当外部高速缓存存储器。作为例子而非限制性的,RAM可以以多种形式获得,比如同步RAM(DRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据速率SDRAM(DDR SDRAM)、增强SDRAM(ESDRAM)、同步链路DRAM(SLDRAM)、以及直接Rambus RAM(DRRAM)。所公开的方面的存储设备意在包括但不限于这些和其它合适类型的存储器。
本领域技术人员还将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。为了清楚地说明硬件和软件的这种可互换性,已经就各种示意性组件、方块、模块、电路和步骤的功能对其进行了一般性的描述。这种功能是被实现为软件还是被实现为硬件取决于具体应用以及施加给整个系统的设计约束。本领域技术人员可以针对每种具体应用以各种方式来实现的功能,但是这种实现决定不应被解释为导致脱离本发明实施例公开的范围。
结合这里的公开所描述的各种示例性逻辑块、模块和电路可以利用被设计成用于执行这里功能的下列部件来实现或执行:通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或其它可编程逻辑器件、分立门或晶体管逻辑、分立的硬件组件或者这些部件的任何组合。通用处理器可以是微处理器,但是可替换地,处理器可以是任何传统处理器、控制器、微控制器或状态机。处理器也可以被实现 为计算设备的组合,例如,DSP和微处理器的组合、多个微处理器、一个或多个微处理器结合DSP和/或任何其它这种配置。
结合这里的公开所描述的方法或算法的步骤可以直接包含在硬件中、由处理器执行的软件模块中或这两者的组合中。软件模块可以驻留在RAM存储器、快闪存储器、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、可移动盘、CD-ROM、或本领域已知的任何其它形式的存储介质中。示例性的存储介质被耦合到处理器,使得处理器能够从该存储介质中读取信息或向该存储介质写入信息。在一个替换方案中,存储介质可以与处理器集成在一起。处理器和存储介质可以驻留在ASIC中。ASIC可以驻留在用户终端中。在一个替换方案中,处理器和存储介质可以作为分立组件驻留在用户终端中。
在一个或多个示例性设计中,功能可以在硬件、软件、固件或其任意组合中实现。如果在软件中实现,则可以将功能作为一个或多个指令或代码存储在计算机可读介质上或通过计算机可读介质来传送。计算机可读介质包括计算机存储介质和通信介质,该通信介质包括有助于将计算机程序从一个位置传送到另一个位置的任何介质。存储介质可以是能够被通用或专用计算机访问的任何可用介质。作为例子而非限制性的,该计算机可读介质可以包括RAM、ROM、EEPROM、CD-ROM或其它光盘存储设备、磁盘存储设备或其它磁性存储设备,或者是可以用于携带或存储形式为指令或数据结构的所需程序代码并且能够被通用或专用计算机或者通用或专用处理器访问的任何其它介质。此外,任何连接都可以适当地称为计算机可读介质。例如,如果使用同轴线缆、光纤线缆、双绞线、数字用户线 路(DSL)或诸如红外线、无线电和微波的无线技术来从网站、服务器或其它远程源发送软件,则上述同轴线缆、光纤线缆、双绞线、DSL或诸如红外线、无线电和微波的无线技术均包括在介质的定义。如这里所使用的,磁盘和光盘包括压缩盘(CD)、激光盘、光盘、数字多功能盘(DVD)、软盘、蓝光盘,其中磁盘通常磁性地再现数据,而光盘利用激光光学地再现数据。上述内容的组合也应当包括在计算机可读介质的范围内。
以上是本发明公开的示例性实施例,但是应当注意,在不背离权利要求限定的本发明实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。此外,尽管本发明实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。
应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。
上述本发明实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例 性的,并非旨在暗示本发明实施例公开的范围(包括权利要求)被限于这些例子;在本发明实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上的本发明实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本发明实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。

Claims (10)

  1. 一种向VMWare虚拟机传输文件的方法,其特征在于,所述方法包括:
    为VMWare虚拟机创建用于向所述VMWare虚拟机中写入外部的文件的第一HTTP REST接口;
    为NOVNC的代理程序封装第二HTTP REST接口,所述第二HTTP REST接口调用所述第一HTTP REST接口进行文件流的传输;
    在所述NOVNC的展示界面创建上传文件节点,并由所述NOVNC通过所述上传文件节点将待传输文件以所述文件流的方式传递到所述代理程序;
    使所述代理程序通过所述第二HTTP REST接口以及所述第一HTTP REST接口将所述文件以文件流的方式传递到所述VMWare虚拟机。
  2. 根据权利要求1所述的向VMWare虚拟机传输文件的方法,其特征在于,所述为VMWare虚拟机创建用于向所述VMWare虚拟机中写入外部的文件的第一HTTP REST接口还包括:
    所述第一HTTP REST接口调用所述VMWare虚拟机提供的SDK接口实现向所述VMWare虚拟机中写入所述外部的文件。
  3. 根据权利要求1所述的向VMWare虚拟机传输文件的方法,其特征在于,所述NOVNC的代理程序为websockify。
  4. 根据权利要求1所述的向VMWare虚拟机传输文件的方法,其特征在于,所述方法还包括:
    在所述VMWare虚拟机中安装VMWare Tools,通过所述VMWare Tools中的文件写入节点为所述VMWare虚拟机创建所述第一HTTP REST接口。
  5. 根据权利要求1所述的向VMWare虚拟机传输文件的方法,其特征在于,使所述代理程序通过所述第二HTTP REST接口以及所述第一HTTP REST接口将所述文件以文件流的方式传递到所述VMWare虚拟机还包括:
    所述代理程序调用所述第一HTTP REST接口,将所述文件传递到VMWare Tools的文件写入节点,并由文件写入节点将文件以流的方式写入到所述VMWare虚拟机中。
  6. 一种向VMWare虚拟机传输文件的装置,其特征在于,所述装置包括:
    写入接口模块,所述写入接口模块配置为为VMWare虚拟机创建用于向所述VMWare虚拟机中写入外部的文件的第一HTTP REST接口;
    接口调用模块,所述接口调用模块配置为为NOVNC的代理程序封装第二HTTP REST接口,所述第二HTTP REST接口调用所述第一HTTP REST接口进行文件流的传输;
    上传文件模块,所述上传文件模块配置为在所述NOVNC的展示界面创建上传文件节点,并由所述NOVNC通过所述上传文件节点将待传输文件以所述文件流的方式传递到所述代理程序;
    文件传递模块,所述文件传递模块配置为使所述代理程序通过所述第 二HTTP REST接口以及所述第一HTTP REST接口将所述文件以文件流的方式传递到所述VMWare虚拟机。
  7. 根据权利要求6所述的向VMWare虚拟机传输文件的装置,其特征在于,所述写入接口模块还配置为:
    所述第一HTTP REST接口调用所述VMWare虚拟机提供的SDK接口实现向所述VMWare虚拟机中写入所述外部的文件。
  8. 根据权利要求6所述的向VMWare虚拟机传输文件的装置,其特征在于,所述装置还包括:
    工具安装模块,所述工具安装模块配置为在所述VMWare虚拟机中安装VMWare Tools,通过所述VMWare Tools中的文件写入节点为所述VMWare虚拟机创建所述第一HTTP REST接口。
  9. 一种计算机设备,其特征在于,包括:
    至少一个处理器;以及
    存储器,所述存储器存储有可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时执行如权利要求1-5任意一项所述的方法。
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时执行权利要求1-5任意一项所述的方法。
PCT/CN2020/118344 2020-02-29 2020-09-28 一种向VMWare虚拟机传输文件的方法、装置、设备和介质 WO2021169285A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010132887.5A CN111371885B (zh) 2020-02-29 2020-02-29 一种向VMWare虚拟机传输文件的方法、装置、设备和介质
CN202010132887.5 2020-02-29

Publications (1)

Publication Number Publication Date
WO2021169285A1 true WO2021169285A1 (zh) 2021-09-02

Family

ID=71211684

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/118344 WO2021169285A1 (zh) 2020-02-29 2020-09-28 一种向VMWare虚拟机传输文件的方法、装置、设备和介质

Country Status (2)

Country Link
CN (1) CN111371885B (zh)
WO (1) WO2021169285A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111371885B (zh) * 2020-02-29 2022-02-18 苏州浪潮智能科技有限公司 一种向VMWare虚拟机传输文件的方法、装置、设备和介质
CN113472878B (zh) * 2021-06-29 2022-04-26 烽火通信科技股份有限公司 利用浏览器插件实现vnc中文件拖拽传输的方法及装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100138476A1 (en) * 2008-12-01 2010-06-03 Gokaraju Ravi Kiran Adaptive screen painting to enhance user perception during remote management sessions
CN103281306A (zh) * 2013-05-03 2013-09-04 四川省电力公司信息通信公司 云数据中心虚拟化基础架构平台
CN106027629A (zh) * 2016-05-13 2016-10-12 北京思特奇信息技术股份有限公司 一种自动化云服务开通方法及系统
CN107634892A (zh) * 2017-09-08 2018-01-26 郑州云海信息技术有限公司 一种Xenserver基于novnc实现控制台的方法及装置
CN109194742A (zh) * 2018-09-04 2019-01-11 郑州云海信息技术有限公司 一种虚拟机控制台的连接方法、装置及存储介质
CN111371885A (zh) * 2020-02-29 2020-07-03 苏州浪潮智能科技有限公司 一种向VMWare虚拟机传输文件的方法、装置、设备和介质

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8589683B2 (en) * 2009-10-27 2013-11-19 Red Hat, Inc. Authentication of a secure virtual network computing (VNC) connection
US8606892B2 (en) * 2011-11-28 2013-12-10 Wyse Technology Inc. Deployment and updating of applications and drivers on a client device using an extensible markup language (XML) configuration file
CN103200215A (zh) * 2012-01-08 2013-07-10 佳都新太科技股份有限公司 一种在https上实现XenServer虚拟机远程控制的方法
CN103795759B (zh) * 2012-10-31 2018-02-09 北京搜狐新媒体信息技术有限公司 一种虚拟机镜像文件的调度方法和系统
CN104199683B (zh) * 2014-08-07 2017-10-17 新华三技术有限公司 一种iso镜像文件加载方法和设备
CN105338048A (zh) * 2014-08-13 2016-02-17 北京云端时代科技有限公司 一种虚拟桌面基础架构下的文件传输方法和系统
CN105933415A (zh) * 2016-04-21 2016-09-07 国家计算机网络与信息安全管理中心 一种基于vnc代理的云计算环境中虚拟机在线录屏方法与系统
CN107193634A (zh) * 2017-05-23 2017-09-22 郑州云海信息技术有限公司 一种虚拟机的访问方法及装置
WO2019080010A1 (zh) * 2017-10-25 2019-05-02 深圳市互盟科技股份有限公司 基于云计算的虚拟机控制系统及其方法
CN108512928A (zh) * 2018-04-08 2018-09-07 上海微穹信息科技有限公司 云端虚拟机及其文件管理方法、系统、虚拟机瘦客户端
CN109743293B (zh) * 2018-12-13 2021-05-25 烽台科技(北京)有限公司 网络靶场的访问方法及网络靶场系统、计算机存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100138476A1 (en) * 2008-12-01 2010-06-03 Gokaraju Ravi Kiran Adaptive screen painting to enhance user perception during remote management sessions
CN103281306A (zh) * 2013-05-03 2013-09-04 四川省电力公司信息通信公司 云数据中心虚拟化基础架构平台
CN106027629A (zh) * 2016-05-13 2016-10-12 北京思特奇信息技术股份有限公司 一种自动化云服务开通方法及系统
CN107634892A (zh) * 2017-09-08 2018-01-26 郑州云海信息技术有限公司 一种Xenserver基于novnc实现控制台的方法及装置
CN109194742A (zh) * 2018-09-04 2019-01-11 郑州云海信息技术有限公司 一种虚拟机控制台的连接方法、装置及存储介质
CN111371885A (zh) * 2020-02-29 2020-07-03 苏州浪潮智能科技有限公司 一种向VMWare虚拟机传输文件的方法、装置、设备和介质

Also Published As

Publication number Publication date
CN111371885B (zh) 2022-02-18
CN111371885A (zh) 2020-07-03

Similar Documents

Publication Publication Date Title
US9009219B2 (en) Native viewer use for service results from a remote desktop
US8296357B2 (en) Systems and methods for remoting multimedia plugin calls
US9378049B1 (en) Servicing I/O requests in an I/O adapter device
US9813485B2 (en) Communication of virtual machine data
US8839233B2 (en) Discovering and installing web application plugins
US9910977B2 (en) Data sharing between multiple applications running on a mobile device
US8924592B2 (en) Synchronization of server-side cookies with client-side cookies
US8645672B2 (en) Configuring a computer system for a software package installation
US9531813B2 (en) Sandboxed application data redirection to datacenters
US10353843B1 (en) Streaming interconnect architecture
US20130174158A1 (en) Methods and systems for provisioning a virtual disk to diskless virtual and physical machines
WO2021169285A1 (zh) 一种向VMWare虚拟机传输文件的方法、装置、设备和介质
JP2018045704A (ja) リモーティングセッションを通じた非サポートファイル形式の開封
US9639691B2 (en) Dynamic database and API-accessible credentials data store
WO2021128903A1 (zh) 加快读取现场可更换单元信息的方法、系统、设备及介质
TW201814509A (zh) 實現網路頁面與本體應用通信的方法、裝置和電子設備
TW201738746A (zh) 分析包裝後修復的紀錄與使用的方法及系統
US9936049B2 (en) Protocol independent way for dynamically selecting data compression methods for redirected USB devices
US20150271286A1 (en) Data Transmission
US20220269378A1 (en) Persistent State and Organization of Workspaces in User Interfaces
WO2020063607A1 (zh) 一种应用客户端启动方法,业务服务器和客户端设备
US20160183401A1 (en) Systems and methods for mounting and dismounting computing components
JP2022530440A (ja) オンプレミスおよびオフプレミスのデバッグ
EP4098002A1 (en) Just in time connection configuration stored in sim profile
CN110659035A (zh) 一种基于bmc批量挂载镜像的方法和装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20921802

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20921802

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20921802

Country of ref document: EP

Kind code of ref document: A1